summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMiss Islington (bot) <31488909+miss-islington@users.noreply.github.com>2020-05-27 13:05:03 (GMT)
committerGitHub <noreply@github.com>2020-05-27 13:05:03 (GMT)
commit5594c07d97cc56ec7fabc66c6a5c644d3b809612 (patch)
tree3605c8ea7ad4c86c1f4ad5c362981844d8ffbe83
parent7c82528d40acae2edf0eb73632e65b044792eeac (diff)
downloadcpython-5594c07d97cc56ec7fabc66c6a5c644d3b809612.zip
cpython-5594c07d97cc56ec7fabc66c6a5c644d3b809612.tar.gz
cpython-5594c07d97cc56ec7fabc66c6a5c644d3b809612.tar.bz2
Clean up compatibility code in importlib fixtures (GH-19156) (#19543)
(cherry picked from commit 574547a75c79b506261520c5773ae08a1dcea1b9) Co-authored-by: Jason R. Coombs <jaraco@jaraco.com> Co-authored-by: Jason R. Coombs <jaraco@jaraco.com>
-rw-r--r--Lib/test/test_importlib/fixtures.py18
1 files changed, 2 insertions, 16 deletions
diff --git a/Lib/test/test_importlib/fixtures.py b/Lib/test/test_importlib/fixtures.py
index 695c92a..d923cec 100644
--- a/Lib/test/test_importlib/fixtures.py
+++ b/Lib/test/test_importlib/fixtures.py
@@ -1,25 +1,11 @@
-from __future__ import unicode_literals
-
import os
import sys
import shutil
+import pathlib
import tempfile
import textwrap
import contextlib
-try:
- from contextlib import ExitStack
-except ImportError:
- from contextlib2 import ExitStack
-
-try:
- import pathlib
-except ImportError:
- import pathlib2 as pathlib
-
-
-__metaclass__ = type
-
@contextlib.contextmanager
def tempdir():
@@ -58,7 +44,7 @@ def install_finder(finder):
class Fixtures:
def setUp(self):
- self.fixtures = ExitStack()
+ self.fixtures = contextlib.ExitStack()
self.addCleanup(self.fixtures.close)