Clean up compatibility code in importlib fixtures (GH-19156) (#19543)

(cherry picked from commit 574547a75c)

Co-authored-by: Jason R. Coombs <jaraco@jaraco.com>

Co-authored-by: Jason R. Coombs <jaraco@jaraco.com>
This commit is contained in:
Miss Islington (bot) 2020-05-27 06:05:03 -07:00 committed by GitHub
parent 7c82528d40
commit 5594c07d97
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 2 additions and 16 deletions

View File

@ -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)