diff --git a/Lib/tarfile.py b/Lib/tarfile.py index f4dd0fdab4a3e4..42bc80e3ec72cf 100755 --- a/Lib/tarfile.py +++ b/Lib/tarfile.py @@ -2408,7 +2408,7 @@ def _extract_member(self, tarinfo, targetpath, set_attrs=True, # Create all upper directories. upperdirs = os.path.dirname(targetpath) - if upperdirs and not os.path.exists(upperdirs): + if upperdirs: # Create directories that are not part of the archive with # default permissions. os.makedirs(upperdirs, exist_ok=True)