From 3c898fa483b143ddec557a1b7fea9df088357431 Mon Sep 17 00:00:00 2001 From: James Vega Date: Tue, 26 May 2009 16:27:53 -0400 Subject: [PATCH] supybot-wizard: Handle os.makedirs errors on Windows Signed-off-by: James Vega --- scripts/supybot-wizard | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/scripts/supybot-wizard b/scripts/supybot-wizard index f23bf6294..184c5d50c 100644 --- a/scripts/supybot-wizard +++ b/scripts/supybot-wizard @@ -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():