summaryrefslogtreecommitdiffstats
path: root/Lib/exceptions.py
diff options
context:
space:
mode:
authorJeremy Hylton <jeremy@alum.mit.edu>1998-07-28 17:30:06 (GMT)
committerJeremy Hylton <jeremy@alum.mit.edu>1998-07-28 17:30:06 (GMT)
commitec8c8c2ef2cac83a12b249c4e6ba4c62c018bfdc (patch)
treed8bce6e6e21701ec729b18de8d5ddb54d2f314fb /Lib/exceptions.py
parentee7fd697bf2e1752f2a484030906ea7b7912e0e8 (diff)
downloadcpython-ec8c8c2ef2cac83a12b249c4e6ba4c62c018bfdc.zip
cpython-ec8c8c2ef2cac83a12b249c4e6ba4c62c018bfdc.tar.gz
cpython-ec8c8c2ef2cac83a12b249c4e6ba4c62c018bfdc.tar.bz2
fix __str__ method of EnvironmentError (base class of IOError): was
using "%d" % errno to print out IOError exceptions -- but urllib.py raises exceptions where the errno slot in the exception tuple is a string.
Diffstat (limited to 'Lib/exceptions.py')
-rw-r--r--Lib/exceptions.py4
1 files changed, 2 insertions, 2 deletions
diff --git a/Lib/exceptions.py b/Lib/exceptions.py
index 9eba588..a81ec3c 100644
--- a/Lib/exceptions.py
+++ b/Lib/exceptions.py
@@ -105,10 +105,10 @@ class EnvironmentError(StandardError):
def __str__(self):
if self.filename:
- return '[Errno %d] %s: %s' % (self.errno, self.strerror,
+ return '[Errno %s] %s: %s' % (self.errno, self.strerror,
self.filename)
elif self.errno and self.strerror:
- return '[Errno %d] %s' % (self.errno, self.strerror)
+ return '[Errno %s] %s' % (self.errno, self.strerror)
else:
return StandardError.__str__(self)