summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJason R. Coombs <jaraco@jaraco.com>2020-04-15 17:55:43 (GMT)
committerGitHub <noreply@github.com>2020-04-15 17:55:43 (GMT)
commit574547a75c79b506261520c5773ae08a1dcea1b9 (patch)
tree9a013ff94acc1ac08c652aa5c41070dbec684242
parent5eca75df031d3cbe577c75dd87734b48c787e7f6 (diff)
downloadcpython-574547a75c79b506261520c5773ae08a1dcea1b9.zip
cpython-574547a75c79b506261520c5773ae08a1dcea1b9.tar.gz
cpython-574547a75c79b506261520c5773ae08a1dcea1b9.tar.bz2
Clean up compatibility code in importlib fixtures (#19156)
-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)