summaryrefslogtreecommitdiffstats
path: root/Lib/tarfile.py
diff options
context:
space:
mode:
authorAndrew Svetlov <andrew.svetlov@gmail.com>2012-12-17 21:35:18 (GMT)
committerAndrew Svetlov <andrew.svetlov@gmail.com>2012-12-17 21:35:18 (GMT)
commit3438fa496db50ef3cafcfdb3243f2f769bc12ebe (patch)
tree8c480821ca46d7d91d4f3ba8c8343afe389d7208 /Lib/tarfile.py
parent6eda46de99189812e6982f568bbe941346918964 (diff)
downloadcpython-3438fa496db50ef3cafcfdb3243f2f769bc12ebe.zip
cpython-3438fa496db50ef3cafcfdb3243f2f769bc12ebe.tar.gz
cpython-3438fa496db50ef3cafcfdb3243f2f769bc12ebe.tar.bz2
Get rig of EnvironmentError (#16705)
Diffstat (limited to 'Lib/tarfile.py')
-rw-r--r--Lib/tarfile.py8
1 files changed, 4 insertions, 4 deletions
diff --git a/Lib/tarfile.py b/Lib/tarfile.py
index 93e6cd9..c0ae8b1 100644
--- a/Lib/tarfile.py
+++ b/Lib/tarfile.py
@@ -2022,7 +2022,7 @@ class TarFile(object):
try:
self._extract_member(tarinfo, os.path.join(path, tarinfo.name),
set_attrs=set_attrs)
- except EnvironmentError as e:
+ except OSError as e:
if self.errorlevel > 0:
raise
else:
@@ -2212,7 +2212,7 @@ class TarFile(object):
os.lchown(targetpath, u, g)
else:
os.chown(targetpath, u, g)
- except EnvironmentError as e:
+ except OSError as e:
raise ExtractError("could not change owner")
def chmod(self, tarinfo, targetpath):
@@ -2221,7 +2221,7 @@ class TarFile(object):
if hasattr(os, 'chmod'):
try:
os.chmod(targetpath, tarinfo.mode)
- except EnvironmentError as e:
+ except OSError as e:
raise ExtractError("could not change mode")
def utime(self, tarinfo, targetpath):
@@ -2231,7 +2231,7 @@ class TarFile(object):
return
try:
os.utime(targetpath, (tarinfo.mtime, tarinfo.mtime))
- except EnvironmentError as e:
+ except OSError as e:
raise ExtractError("could not change modification time")
#--------------------------------------------------------------------------