Skip to content

Commit c3f841b

Browse files
committed
Fix a bug in get_git_devstr--I think the old default functionality of using __file__ may have made sense when this was used primarily by Astropy itself, but in the context of an affiliated package it makes no sense.
1 parent 1a75b26 commit c3f841b

1 file changed

Lines changed: 3 additions & 4 deletions

File tree

‎astropy_helpers/git_helpers.py‎

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -60,9 +60,8 @@ def get_git_devstr(sha=False, show_warning=True, path=None):
6060
6161
path : str or None
6262
If a string, specifies the directory to look in to find the git
63-
repository. If None, the location of the file this function is in
64-
is used to infer the git repository location. If given a filename it
65-
uses the directory containing that file.
63+
repository. If `None`, the current working directory is used.
64+
If given a filename it uses the directory containing that file.
6665
6766
Returns
6867
-------
@@ -74,7 +73,7 @@ def get_git_devstr(sha=False, show_warning=True, path=None):
7473
"""
7574

7675
if path is None:
77-
path = __file__
76+
path = os.getcwd()
7877

7978
if not os.path.isdir(path):
8079
path = os.path.abspath(os.path.dirname(path))

0 commit comments

Comments
 (0)