From 8aaf67450d674e76a84f01372a9f86e2540110ec Mon Sep 17 00:00:00 2001 From: Aaron Griffith Date: Sun, 4 Mar 2012 20:11:15 -0500 Subject: [PATCH] setup.py now works regardless of current working directory --- setup.py | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/setup.py b/setup.py index 01814dc..d484cf8 100755 --- a/setup.py +++ b/setup.py @@ -28,6 +28,12 @@ try: except ImportError: py2app = None +# make sure our current working directory is the same directory +# setup.py is in +curdir = os.path.split(sys.argv[0])[0] +if curdir: + os.chdir(curdir) + # now, setup the keyword arguments for setup # (because we don't know until runtime if py2exe/py2app is available) setup_kwargs = {} @@ -44,7 +50,7 @@ setup_kwargs['options'] = {} # README file and 2) it's easier to type in the README file than to put a raw # string in below ... def read(fname): - return open(os.path.join(os.path.dirname(__file__), fname)).read() + return open(fname).read() setup_kwargs['name'] = 'Minecraft-Overviewer' setup_kwargs['version'] = util.findGitVersion()