mirror of
https://github.com/Mikaela/Limnoria.git
synced 2024-12-23 11:12:47 +01:00
supybot-wizard: Handle os.makedirs errors on Windows
Signed-off-by: James Vega <jamessan@users.sourceforge.net>
This commit is contained in:
parent
b170d5f9c3
commit
3c898fa483
@ -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