diff options
author | Serhiy Storchaka <storchaka@gmail.com> | 2013-11-23 20:12:06 (GMT) |
---|---|---|
committer | Serhiy Storchaka <storchaka@gmail.com> | 2013-11-23 20:12:06 (GMT) |
commit | 6787a3806ee6a85a6f21ede70c10e15a6df267c4 (patch) | |
tree | d72149a2f3a4eab3e8f288fa2a25bb1957620d91 /Lib/fileinput.py | |
parent | d41c343f28bd7631cfa866f8276673ccafb71d57 (diff) | |
download | cpython-6787a3806ee6a85a6f21ede70c10e15a6df267c4.zip cpython-6787a3806ee6a85a6f21ede70c10e15a6df267c4.tar.gz cpython-6787a3806ee6a85a6f21ede70c10e15a6df267c4.tar.bz2 |
Issue #15204: Deprecated the 'U' mode in file-like objects.
Diffstat (limited to 'Lib/fileinput.py')
-rw-r--r-- | Lib/fileinput.py | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/Lib/fileinput.py b/Lib/fileinput.py index 3215154..11ba82d 100644 --- a/Lib/fileinput.py +++ b/Lib/fileinput.py @@ -222,6 +222,10 @@ class FileInput: 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("Use of 'U' mode is deprecated", + DeprecationWarning, 2) self._mode = mode if openhook: if inplace: |