mirror of
https://github.com/Mikaela/Limnoria.git
synced 2024-11-30 06:49:24 +01:00
supybot-wizard: Handle os.makedirs errors on Windows
Signed-off-by: James Vega <jamessan@users.sourceforge.net>
(cherry picked from commit 3c898fa483
)
This commit is contained in:
parent
a1286f8f43
commit
8bb49e8873
@ -140,13 +140,15 @@ def getDirectoryName(default, basedir=os.curdir, prompt=True):
|
||||
os.makedirs(dir)
|
||||
done = True
|
||||
except OSError, e:
|
||||
if e.args[0] != 17: # File exists.
|
||||
# 17 is File exists for Linux (and likely other POSIX systems)
|
||||
# 183 is the same for Windows
|
||||
if e.args[0] == 17 or (os.name == 'nt' and e.args[0] == 183):
|
||||
done = True
|
||||
else:
|
||||
output("""Sorry, I couldn't make that directory for some
|
||||
reason. The Operating System told me %s. You're going to
|
||||
have to pick someplace else.""" % e)
|
||||
prompt = True
|
||||
else:
|
||||
done = True
|
||||
return (dir, os.path.dirname(orig_dir))
|
||||
|
||||
def main():
|
||||
|
Loading…
Reference in New Issue
Block a user