From 574547a75c79b506261520c5773ae08a1dcea1b9 Mon Sep 17 00:00:00 2001 From: "Jason R. Coombs" Date: Wed, 15 Apr 2020 13:55:43 -0400 Subject: [PATCH] Clean up compatibility code in importlib fixtures (#19156) --- Lib/test/test_importlib/fixtures.py | 18 ++---------------- 1 file changed, 2 insertions(+), 16 deletions(-) diff --git a/Lib/test/test_importlib/fixtures.py b/Lib/test/test_importlib/fixtures.py index 695c92a786c..d923cec26ea 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)