diff options
author | Emile Anclin <emile.anclin@logilab.fr> | 2010-11-08 15:19:01 +0100 |
---|---|---|
committer | Emile Anclin <emile.anclin@logilab.fr> | 2010-11-08 15:19:01 +0100 |
commit | c715026e96f653306b2a45754d2d5d4e186c25a7 (patch) | |
tree | a7ca3ba5492153dcfc156563af1e5cad8773da39 /fileutils.py | |
parent | 5010f6cd170b8902286d2984ea1457c415d0c87e (diff) | |
download | logilab-common-c715026e96f653306b2a45754d2d5d4e186c25a7.tar.gz |
cleanup: remove python <=2.2 relative stuff
Diffstat (limited to 'fileutils.py')
-rw-r--r-- | fileutils.py | 13 |
1 files changed, 2 insertions, 11 deletions
diff --git a/fileutils.py b/fileutils.py index 3d030e9..2e81000 100644 --- a/fileutils.py +++ b/fileutils.py @@ -243,11 +243,6 @@ def relative_path(from_file, to_file): return sep.join(result) -from logilab.common.textutils import _LINE_RGX -from sys import version_info -_HAS_UNIV_OPEN = version_info[:2] >= (2, 3) -del version_info - def norm_read(path): """Return the content of the file with normalized line feeds. @@ -257,9 +252,7 @@ def norm_read(path): :rtype: str :return: the content of the file with normalized line feeds """ - if _HAS_UNIV_OPEN: - return open(path, 'U').read() - return _LINE_RGX.sub('\n', open(path).read()) + return open(path, 'U').read() def norm_open(path): @@ -271,9 +264,7 @@ def norm_open(path): :rtype: file or StringIO :return: the opened file with normalized line feeds """ - if _HAS_UNIV_OPEN: - return open(path, 'U') - return StringIO(_LINE_RGX.sub('\n', open(path).read())) + return open(path, 'U') def lines(path, comments=None): |