diff options
author | Stefan Behnel <stefan_ml@behnel.de> | 2015-05-30 10:10:45 +0200 |
---|---|---|
committer | Stefan Behnel <stefan_ml@behnel.de> | 2015-05-30 10:10:45 +0200 |
commit | 548deaf2cbb790e2a2f5672f45e3f0fdf4cd637c (patch) | |
tree | 16c4b3208498ff766e72096426f5e06e1321d5c4 /Cython/Utils.py | |
parent | d6109ba4ea795515fab3665f1ed355e547c75c7e (diff) | |
download | cython-548deaf2cbb790e2a2f5672f45e3f0fdf4cd637c.tar.gz |
remove usage of deprecated "U" file open mode flag which is enabled anyway
Diffstat (limited to 'Cython/Utils.py')
-rw-r--r-- | Cython/Utils.py | 13 |
1 files changed, 4 insertions, 9 deletions
diff --git a/Cython/Utils.py b/Cython/Utils.py index 22f6db773..60c0f89fe 100644 --- a/Cython/Utils.py +++ b/Cython/Utils.py @@ -244,16 +244,13 @@ def skip_bom(f): def open_source_file(source_filename, mode="r", - encoding=None, error_handling=None, - require_normalised_newlines=True): + encoding=None, error_handling=None): if encoding is None: # Most of the time the coding is unspecified, so be optimistic that # it's UTF-8. f = open_source_file(source_filename, encoding="UTF-8", mode=mode, error_handling='ignore') encoding = detect_opened_file_encoding(f) - if (encoding == "UTF-8" - and error_handling == 'ignore' - and require_normalised_newlines): + if encoding == "UTF-8" and error_handling == 'ignore': f.seek(0) skip_bom(f) return f @@ -266,8 +263,7 @@ def open_source_file(source_filename, mode="r", if source_filename.startswith(loader.archive): return open_source_from_loader( loader, source_filename, - encoding, error_handling, - require_normalised_newlines) + encoding, error_handling) except (NameError, AttributeError): pass @@ -279,8 +275,7 @@ def open_source_file(source_filename, mode="r", def open_source_from_loader(loader, source_filename, - encoding=None, error_handling=None, - require_normalised_newlines=True): + encoding=None, error_handling=None): nrmpath = os.path.normpath(source_filename) arcname = nrmpath[len(loader.archive)+1:] data = loader.get_data(arcname) |