Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 3 additions & 7 deletions Lib/argparse.py
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@
'ZERO_OR_MORE',
]

import atexit as _atexit

import os as _os
import re as _re
import sys as _sys
Expand Down Expand Up @@ -1268,12 +1268,8 @@ def __call__(self, string):

# all other arguments are used as file names
try:
fh = open(string, self._mode, self._bufsize, self._encoding, self._errors)

# Register cleanup function to close file
_atexit.register(fh.close)

return fh
return open(string, self._mode, self._bufsize, self._encoding,
self._errors)
except OSError as e:
args = {'filename': string, 'error': e}
message = _("can't open '%(filename)s': %(error)s")
Expand Down
1 change: 0 additions & 1 deletion Misc/ACKS
Original file line number Diff line number Diff line change
Expand Up @@ -313,7 +313,6 @@ Nicolas Chauvat
Jerry Chen
Michael Chermside
Ingrid Cheung
Adam Chhina
Terry Chia
Albert Chin-A-Young
Adal Chiriliuc
Expand Down

This file was deleted.