[Python-checkins] cpython: Replace os.error with OSError in tkinter and IDLE
andrew.svetlov
python-checkins at python.org
Mon Dec 17 18:51:25 CET 2012
http://hg.python.org/cpython/rev/bf92327eeda8
changeset: 80916:bf92327eeda8
user: Andrew Svetlov <andrew.svetlov at gmail.com>
date: Mon Dec 17 19:51:15 2012 +0200
summary:
Replace os.error with OSError in tkinter and IDLE
files:
Lib/idlelib/FileList.py | 2 +-
Lib/idlelib/GrepDialog.py | 2 +-
Lib/idlelib/IOBinding.py | 2 +-
Lib/idlelib/PathBrowser.py | 2 +-
Lib/idlelib/TreeWidget.py | 4 ++--
Lib/tkinter/filedialog.py | 4 ++--
6 files changed, 8 insertions(+), 8 deletions(-)
diff --git a/Lib/idlelib/FileList.py b/Lib/idlelib/FileList.py
--- a/Lib/idlelib/FileList.py
+++ b/Lib/idlelib/FileList.py
@@ -103,7 +103,7 @@
if not os.path.isabs(filename):
try:
pwd = os.getcwd()
- except os.error:
+ except OSError:
pass
else:
filename = os.path.join(pwd, filename)
diff --git a/Lib/idlelib/GrepDialog.py b/Lib/idlelib/GrepDialog.py
--- a/Lib/idlelib/GrepDialog.py
+++ b/Lib/idlelib/GrepDialog.py
@@ -110,7 +110,7 @@
def findfiles(self, dir, base, rec):
try:
names = os.listdir(dir or os.curdir)
- except os.error as msg:
+ except OSError as msg:
print(msg)
return []
list = []
diff --git a/Lib/idlelib/IOBinding.py b/Lib/idlelib/IOBinding.py
--- a/Lib/idlelib/IOBinding.py
+++ b/Lib/idlelib/IOBinding.py
@@ -503,7 +503,7 @@
else:
try:
pwd = os.getcwd()
- except os.error:
+ except OSError:
pwd = ""
return pwd, ""
diff --git a/Lib/idlelib/PathBrowser.py b/Lib/idlelib/PathBrowser.py
--- a/Lib/idlelib/PathBrowser.py
+++ b/Lib/idlelib/PathBrowser.py
@@ -45,7 +45,7 @@
def GetSubList(self):
try:
names = os.listdir(self.dir or os.curdir)
- except os.error:
+ except OSError:
return []
packages = []
for name in names:
diff --git a/Lib/idlelib/TreeWidget.py b/Lib/idlelib/TreeWidget.py
--- a/Lib/idlelib/TreeWidget.py
+++ b/Lib/idlelib/TreeWidget.py
@@ -382,7 +382,7 @@
try:
os.rename(self.path, newpath)
self.path = newpath
- except os.error:
+ except OSError:
pass
def GetIconName(self):
@@ -395,7 +395,7 @@
def GetSubList(self):
try:
names = os.listdir(self.path)
- except os.error:
+ except OSError:
return []
names.sort(key = os.path.normcase)
sublist = []
diff --git a/Lib/tkinter/filedialog.py b/Lib/tkinter/filedialog.py
--- a/Lib/tkinter/filedialog.py
+++ b/Lib/tkinter/filedialog.py
@@ -166,7 +166,7 @@
dir, pat = self.get_filter()
try:
names = os.listdir(dir)
- except os.error:
+ except OSError:
self.master.bell()
return
self.directory = dir
@@ -209,7 +209,7 @@
if not os.path.isabs(dir):
try:
pwd = os.getcwd()
- except os.error:
+ except OSError:
pwd = None
if pwd:
dir = os.path.join(pwd, dir)
--
Repository URL: http://hg.python.org/cpython
More information about the Python-checkins
mailing list