summaryrefslogtreecommitdiffstats
path: root/Lib/tarfile.py
diff options
context:
space:
mode:
Diffstat (limited to 'Lib/tarfile.py')
-rw-r--r--Lib/tarfile.py6
1 files changed, 2 insertions, 4 deletions
diff --git a/Lib/tarfile.py b/Lib/tarfile.py
index 39fe635..cf4e164 100644
--- a/Lib/tarfile.py
+++ b/Lib/tarfile.py
@@ -42,7 +42,6 @@ import sys
import os
import shutil
import stat
-import errno
import time
import struct
import copy
@@ -2281,9 +2280,8 @@ class TarFile(object):
# Use a safe mode for the directory, the real mode is set
# later in _extract_member().
os.mkdir(targetpath, 0o700)
- except EnvironmentError as e:
- if e.errno != errno.EEXIST:
- raise
+ except FileExistsError:
+ pass
def makefile(self, tarinfo, targetpath):
"""Make a file called targetpath.