mirror of
https://github.com/python/cpython.git
synced 2025-08-30 21:48:47 +00:00
Issue #15204: Deprecated the 'U' mode in file-like objects.
This commit is contained in:
parent
d41c343f28
commit
6787a3806e
13 changed files with 45 additions and 13 deletions
|
@ -38,9 +38,9 @@ def main():
|
|||
|
||||
fromdate = file_mtime(fromfile)
|
||||
todate = file_mtime(tofile)
|
||||
with open(fromfile, 'U') as ff:
|
||||
with open(fromfile) as ff:
|
||||
fromlines = ff.readlines()
|
||||
with open(tofile, 'U') as tf:
|
||||
with open(tofile) as tf:
|
||||
tolines = tf.readlines()
|
||||
|
||||
if options.u:
|
||||
|
|
|
@ -60,7 +60,7 @@ def fail(msg):
|
|||
# couldn't be opened
|
||||
def fopen(fname):
|
||||
try:
|
||||
return open(fname, 'U')
|
||||
return open(fname)
|
||||
except IOError as detail:
|
||||
return fail("couldn't open " + fname + ": " + str(detail))
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue