summaryrefslogtreecommitdiff
path: root/setuptools/py31compat.py
diff options
context:
space:
mode:
authorJason R. Coombs <jaraco@jaraco.com>2020-08-16 00:29:24 -0400
committerJason R. Coombs <jaraco@jaraco.com>2020-08-16 07:15:18 -0400
commitfb7ab81a3d080422687bad71f9ae9d36eeefbee2 (patch)
treed87a9f6fdf32ab64334e1eb8a695949a88a3b043 /setuptools/py31compat.py
parent4eb5b32f8d8bb1e20907028a516346e2b1901391 (diff)
downloadpython-setuptools-git-fb7ab81a3d080422687bad71f9ae9d36eeefbee2.tar.gz
Remove Python 2 compatibility
Diffstat (limited to 'setuptools/py31compat.py')
-rw-r--r--setuptools/py31compat.py32
1 files changed, 0 insertions, 32 deletions
diff --git a/setuptools/py31compat.py b/setuptools/py31compat.py
deleted file mode 100644
index e1da7ee2..00000000
--- a/setuptools/py31compat.py
+++ /dev/null
@@ -1,32 +0,0 @@
-__all__ = []
-
-__metaclass__ = type
-
-
-try:
- # Python >=3.2
- from tempfile import TemporaryDirectory
-except ImportError:
- import shutil
- import tempfile
-
- class TemporaryDirectory:
- """
- Very simple temporary directory context manager.
- Will try to delete afterward, but will also ignore OS and similar
- errors on deletion.
- """
-
- def __init__(self, **kwargs):
- self.name = None # Handle mkdtemp raising an exception
- self.name = tempfile.mkdtemp(**kwargs)
-
- def __enter__(self):
- return self.name
-
- def __exit__(self, exctype, excvalue, exctrace):
- try:
- shutil.rmtree(self.name, True)
- except OSError: # removal errors are not the only possible
- pass
- self.name = None