From c11976af7ed196853acebdcf7d290d9764191f2d Mon Sep 17 00:00:00 2001 From: "Jason R. Coombs" Date: Thu, 4 Nov 2021 04:38:20 -0400 Subject: [PATCH] Move os_helper to compat module. --- src/compat.py | 7 +++++++ src/test_configparser.py | 8 +------- 2 files changed, 8 insertions(+), 7 deletions(-) diff --git a/src/compat.py b/src/compat.py index e1ff25c..ec8943d 100644 --- a/src/compat.py +++ b/src/compat.py @@ -8,3 +8,10 @@ def check__all__(*args, **kwargs): with contextlib.suppress(KeyError): kwargs.update(blacklist=kwargs.pop('not_exported')) return test.support.check__all__(*args, **kwargs) + + +try: + from test.support import os_helper +except ImportError: + # Python 3.9 + import test.support as os_helper # noqa: F401 diff --git a/src/test_configparser.py b/src/test_configparser.py index 3ac1129..6a6bdf9 100644 --- a/src/test_configparser.py +++ b/src/test_configparser.py @@ -10,13 +10,7 @@ from collections import UserDict from test import support -try: - from test.support import os_helper -except ImportError: - # Python 3.9 - import test.support as os_helper # noqa: F401 - -from compat import check__all__ +from compat import check__all__, os_helper from backports import configparser