mirror of
https://github.com/python/cpython.git
synced 2026-01-06 23:42:34 +00:00
Insert filename in IOError message.
This commit is contained in:
parent
c9970eecc2
commit
c30461dd38
1 changed files with 4 additions and 1 deletions
|
|
@ -296,7 +296,10 @@ def setoutput(self, spec, defs = None):
|
|||
self.defsmine = mine
|
||||
|
||||
def openoutput(self, filename):
|
||||
file = open(filename, 'w')
|
||||
try:
|
||||
file = open(filename, 'w')
|
||||
except IOError, arg:
|
||||
raise IOError, (filename, arg)
|
||||
self.setfiletype(filename)
|
||||
return file
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue