diff options
| author | Friedemann Kleint <Friedemann.Kleint@qt.io> | 2020-09-03 11:14:55 +0200 |
|---|---|---|
| committer | Friedemann Kleint <Friedemann.Kleint@qt.io> | 2020-09-04 05:26:18 +0000 |
| commit | f47818b5c710aa6ae5f76809046105cb8c3d9f7f (patch) | |
| tree | c83b7acb7d19203519bd70a899bb8c4b23997b7e /sources/pyside2/tests/QtGui/pyside_reload_test.py | |
| parent | e796600c9663a26ccf1929aca8336eb0cb23fe5d (diff) | |
Remove Python2 from PySide2 tests
Task-number: PYSIDE-1339
Task-number: PYSIDE-904
Change-Id: Idc6c185c0c848476a60d91b802af760fc2b70a30
Reviewed-by: Christian Tismer <tismer@stackless.com>
Diffstat (limited to 'sources/pyside2/tests/QtGui/pyside_reload_test.py')
| -rw-r--r-- | sources/pyside2/tests/QtGui/pyside_reload_test.py | 17 |
1 files changed, 6 insertions, 11 deletions
diff --git a/sources/pyside2/tests/QtGui/pyside_reload_test.py b/sources/pyside2/tests/QtGui/pyside_reload_test.py index f3c7c3e8d..75994f4e4 100644 --- a/sources/pyside2/tests/QtGui/pyside_reload_test.py +++ b/sources/pyside2/tests/QtGui/pyside_reload_test.py @@ -26,6 +26,8 @@ ## ############################################################################# +import importlib +import importlib.util import os import shutil import sys @@ -35,7 +37,6 @@ sys.path.append(os.path.dirname(os.path.dirname(os.path.abspath(__file__)))) from init_paths import init_test_paths init_test_paths(False) -import py3kcompat as py3k orig_path = os.path.join(os.path.dirname(__file__)) workdir = os.getcwd() @@ -45,11 +46,8 @@ shutil.copyfile(src, dst) sys.path.append(workdir) def reload_module(moduleName): - if py3k.IS_PY3K: - import importlib - importlib.reload(moduleName) - else: - reload(moduleName) + importlib.reload(moduleName) + def increment_module_value(): modfile = open(dst, 'a') @@ -57,11 +55,8 @@ def increment_module_value(): modfile.flush() modfile.close() if not sys.dont_write_bytecode: - if py3k.IS_PY3K: - import importlib.util - cacheFile = importlib.util.cache_from_source(dst) - else: - cacheFile = dst + 'c' + import importlib.util + cacheFile = importlib.util.cache_from_source(dst) os.remove(cacheFile) class TestModuleReloading(unittest.TestCase): |
