diff options
Diffstat (limited to 'Lib/fileinput.py')
-rw-r--r-- | Lib/fileinput.py | 11 |
1 files changed, 3 insertions, 8 deletions
diff --git a/Lib/fileinput.py b/Lib/fileinput.py index c1b0ec9a8e..166c631689 100644 --- a/Lib/fileinput.py +++ b/Lib/fileinput.py @@ -209,15 +209,10 @@ class FileInput: self._isstdin = False self._backupfilename = None # restrict mode argument to reading modes - if mode not in ('r', 'rU', 'U', 'rb'): - raise ValueError("FileInput opening mode must be one of " - "'r', 'rU', 'U' and 'rb'") - if 'U' in mode: - import warnings - warnings.warn("'U' mode is deprecated", - DeprecationWarning, 2) + if mode not in ('r', 'rb'): + raise ValueError("FileInput opening mode must be 'r' or 'rb'") self._mode = mode - self._write_mode = mode.replace('r', 'w') if 'U' not in mode else 'w' + self._write_mode = mode.replace('r', 'w') if openhook: if inplace: raise ValueError("FileInput cannot use an opening hook in inplace mode") |