diff options
Diffstat (limited to 'Lib/tarfile.py')
-rwxr-xr-x | Lib/tarfile.py | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/Lib/tarfile.py b/Lib/tarfile.py index 721f9d7..999a99b 100755 --- a/Lib/tarfile.py +++ b/Lib/tarfile.py @@ -1549,7 +1549,9 @@ class TarFile(object): if mode in ("r", "r:*"): # Find out which *open() is appropriate for opening the file. - for comptype in cls.OPEN_METH: + def not_compressed(comptype): + return cls.OPEN_METH[comptype] == 'taropen' + for comptype in sorted(cls.OPEN_METH, key=not_compressed): func = getattr(cls, cls.OPEN_METH[comptype]) if fileobj is not None: saved_pos = fileobj.tell() |