summaryrefslogtreecommitdiff
path: root/Lib/tempfile.py
diff options
context:
space:
mode:
Diffstat (limited to 'Lib/tempfile.py')
-rw-r--r--Lib/tempfile.py12
1 files changed, 1 insertions, 11 deletions
diff --git a/Lib/tempfile.py b/Lib/tempfile.py
index e6fb3c8e9a..a66d6f3750 100644
--- a/Lib/tempfile.py
+++ b/Lib/tempfile.py
@@ -70,20 +70,10 @@ template = "tmp"
_once_lock = _allocate_lock()
-if hasattr(_os, "lstat"):
- _stat = _os.lstat
-elif hasattr(_os, "stat"):
- _stat = _os.stat
-else:
- # Fallback. All we need is something that raises OSError if the
- # file doesn't exist.
- def _stat(fn):
- fd = _os.open(fn, _os.O_RDONLY)
- _os.close(fd)
def _exists(fn):
try:
- _stat(fn)
+ _os.lstat(fn)
except OSError:
return False
else: