From b7af39c4ec92ccbcffba39a39f825fe7a970ffc3 Mon Sep 17 00:00:00 2001 From: "Kurt B. Kaiser" Date: Mon, 17 Jan 2005 20:06:47 +0000 Subject: [PATCH] Improve error handling when .idlerc can't be created. This is a partial backport of configHandler.py, Revision 1.36, 11Jan05. --- Lib/idlelib/NEWS.txt | 5 ++++- Lib/idlelib/configHandler.py | 3 ++- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/Lib/idlelib/NEWS.txt b/Lib/idlelib/NEWS.txt index eb74aa01b102..9cbfa8e69398 100644 --- a/Lib/idlelib/NEWS.txt +++ b/Lib/idlelib/NEWS.txt @@ -1,7 +1,10 @@ What's New in IDLE 1.0.4? ========================= -*Release date: XX-Dec-2004* +*Release date: XX-Jan-2005* + +- Improve error handling when .idlerc can't be created. This is a partial + backport of configHandler.py, Revision 1.36, 11Jan05. - The GUI was hanging if the shell window was closed while a raw_input() was pending. Restored the quit() of the readline() mainloop(). diff --git a/Lib/idlelib/configHandler.py b/Lib/idlelib/configHandler.py index 3d79fb9b3ace..dde7813793dc 100644 --- a/Lib/idlelib/configHandler.py +++ b/Lib/idlelib/configHandler.py @@ -209,10 +209,11 @@ class IdleConf: if not os.path.exists(userDir): try: #make the config dir if it doesn't exist yet os.mkdir(userDir) - except IOError: + except (OSError, IOError): warn=('\n Warning: unable to create user config directory\n '+ userDir+'\n') sys.stderr.write(warn) + raise SystemExit return userDir def GetOption(self, configType, section, option, default=None, type=None): -- 2.47.3