Skip to content

Commit

Permalink
Use absolute path when looking for git repo
Browse files Browse the repository at this point in the history
When pip is installing from github, __file__ is a relative path, and by
skipping to the project root we actually created an empty string. By
making sure we work with absolute path this can be prevented.
  • Loading branch information
lubomir committed Aug 7, 2015
1 parent c184c7b commit f890273
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion pdc/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
VERSION = "v0.1.0-alpha.2"

old_cwd = os.getcwd()
os.chdir(os.path.dirname(os.path.dirname(__file__)))
os.chdir(os.path.dirname(os.path.dirname(os.path.abspath(__file__))))
# NOTE(xchu): use `git describe` when under git repository.
if os.system('git rev-parse 2> /dev/null > /dev/null') == 0:
pipe = subprocess.Popen("git describe",
Expand Down

0 comments on commit f890273

Please sign in to comment.