Skip to content

Commit

Permalink
Only error if directory really does not exist
Browse files Browse the repository at this point in the history
On Windows, a user is getting an error from makedirs() with the argument
of the current directory '.'.  Per the comments in a more recent `os.py`
let’s refuse to error out if the directory exists.

Hopefully, fix #283.
  • Loading branch information
brandon-rhodes committed Aug 27, 2019
1 parent 6eec16a commit 08165fc
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion skyfield/iokit.py
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,7 @@ def __init__(self, directory, verbose=True, expire=True):
try:
os.makedirs(self.directory)
except OSError as e:
if e.errno != errno.EEXIST:
if e.errno != errno.EEXIST and not os.path.isdir(name):
raise

# Each instance gets its own copy of these data structures,
Expand Down

0 comments on commit 08165fc

Please sign in to comment.