mirror of
https://github.com/python/cpython.git
synced 2025-08-03 16:39:00 +00:00
Issue #1066: implement PEP 3109, 2/3 of PEP 3134.
This commit is contained in:
parent
150b7d7d02
commit
828f04ac3f
32 changed files with 761 additions and 253 deletions
|
@ -267,7 +267,7 @@ class Checker:
|
|||
def setflags(self, **kw):
|
||||
for key in kw.keys():
|
||||
if key not in self.validflags:
|
||||
raise NameError, "invalid keyword argument: %s" % str(key)
|
||||
raise NameError("invalid keyword argument: %s" % str(key))
|
||||
for key, value in kw.items():
|
||||
setattr(self, key, value)
|
||||
|
||||
|
@ -761,7 +761,7 @@ class MyURLopener(urllib.FancyURLopener):
|
|||
names = os.listdir(path)
|
||||
except os.error as msg:
|
||||
exc_type, exc_value, exc_tb = sys.exc_info()
|
||||
raise IOError, msg, exc_tb
|
||||
raise IOError(msg).with_traceback(exc_tb)
|
||||
names.sort()
|
||||
s = MyStringIO("file:"+url, {'content-type': 'text/html'})
|
||||
s.write('<BASE HREF="file:%s">\n' %
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue