diff options
Diffstat (limited to 'sources/pyside6')
5 files changed, 16 insertions, 16 deletions
diff --git a/sources/pyside6/PySide6/support/generate_pyi.py b/sources/pyside6/PySide6/support/generate_pyi.py index b5691f190..0c3bc2462 100644 --- a/sources/pyside6/PySide6/support/generate_pyi.py +++ b/sources/pyside6/PySide6/support/generate_pyi.py @@ -96,7 +96,7 @@ def generate_all_pyi(outpath, options): # PYSIDE-535: We cannot use __feature__ yet in PyPy generate_pyi(import_name, outpath, options) else: - import __feature__ as feature + from PySide6.support import feature feature_id = feature.get_select_id(options.feature) with feature.force_selection(feature_id, import_name): generate_pyi(import_name, outpath, options) diff --git a/sources/pyside6/tests/QtCore/errormessages_with_features_test.py b/sources/pyside6/tests/QtCore/errormessages_with_features_test.py index 3ba65b071..c0bce25e3 100644 --- a/sources/pyside6/tests/QtCore/errormessages_with_features_test.py +++ b/sources/pyside6/tests/QtCore/errormessages_with_features_test.py @@ -51,7 +51,7 @@ from PySide6.QtWidgets import QApplication, QLabel is_pypy = hasattr(sys, "pypy_version_info") if not is_pypy: - from PySide6.support import __feature__ + from PySide6.support import feature import inspect @@ -74,10 +74,10 @@ class ErrormessagesWithFeatures(unittest.TestCase): def setUp(self): qApp or QApplication() - __feature__.set_selection(0) + feature.reset() def tearDown(self): - __feature__.set_selection(0) + feature.reset() qApp.shutdown() def testCorrectErrorMessagesPlain(self): diff --git a/sources/pyside6/tests/QtCore/multiple_feature_test.py b/sources/pyside6/tests/QtCore/multiple_feature_test.py index de26a09e1..325157606 100644 --- a/sources/pyside6/tests/QtCore/multiple_feature_test.py +++ b/sources/pyside6/tests/QtCore/multiple_feature_test.py @@ -50,7 +50,7 @@ from PySide6.QtCore import QCborArray, QObject is_pypy = hasattr(sys, "pypy_version_info") if not is_pypy: - from PySide6.support import __feature__ + from PySide6.support import feature from textwrap import dedent @@ -122,20 +122,20 @@ class FeaturesTest(unittest.TestCase): """), "<string>", "exec"), globals(), edict) globals().update(edict) - feature_list = __feature__._really_all_feature_names + feature_list = feature._really_all_feature_names func_list = [tst_bit0, tst_bit1, tst_bit2, tst_bit3, tst_bit4, tst_bit5, tst_bit6, tst_bit7] for idx in range(0x100): - __feature__.set_selection(0) + feature.reset() config = f"feature_{idx:02x}" print() print(f"--- Feature Test Config `{config}` ---") print("Imports:") for bit in range(8): if idx & 1 << bit: - feature = feature_list[bit] - text = f"from __feature__ import {feature}" + cur_feature = feature_list[bit] + text = f"from __feature__ import {cur_feature}" print(text) eval(compile(text, "<string>", "exec"), globals(), edict) for bit in range(8): diff --git a/sources/pyside6/tests/QtCore/snake_prop_feature_test.py b/sources/pyside6/tests/QtCore/snake_prop_feature_test.py index ad28dbd0a..08b320c03 100644 --- a/sources/pyside6/tests/QtCore/snake_prop_feature_test.py +++ b/sources/pyside6/tests/QtCore/snake_prop_feature_test.py @@ -51,7 +51,7 @@ from PySide6.QtWidgets import QApplication, QMainWindow, QWidget is_pypy = hasattr(sys, "pypy_version_info") if not is_pypy: - from PySide6.support import __feature__ + from PySide6.support import feature """ snake_prop_feature_test.py @@ -72,10 +72,10 @@ class Window(QWidget): class FeatureTest(unittest.TestCase): def setUp(self): qApp or QApplication() - __feature__.set_selection(0x80) # FIXME: 0 is insecure + feature.reset() def tearDown(self): - __feature__.set_selection(0) + feature.reset() qApp.shutdown() def testRenamedFunctions(self): @@ -105,7 +105,7 @@ class FeatureTest(unittest.TestCase): window.isModal # switching back - __feature__.set_selection(0) + feature.reset() self.assertTrue(callable(window.isModal)) with self.assertRaises(AttributeError): diff --git a/sources/pyside6/tests/pysidetest/constructor_properties_test.py b/sources/pyside6/tests/pysidetest/constructor_properties_test.py index 47d0d4eeb..384c7200f 100644 --- a/sources/pyside6/tests/pysidetest/constructor_properties_test.py +++ b/sources/pyside6/tests/pysidetest/constructor_properties_test.py @@ -53,7 +53,7 @@ from PySide6.QtWidgets import QApplication, QLabel, QFrame is_pypy = hasattr(sys, "pypy_version_info") if not is_pypy: - from PySide6.support import __feature__ + from PySide6.support import feature class ConstructorPropertiesTest(unittest.TestCase): @@ -61,11 +61,11 @@ class ConstructorPropertiesTest(unittest.TestCase): def setUp(self): qApp or QApplication() if not is_pypy: - __feature__.set_selection(0x80) # FIXME: 0 is insecure + feature.reset() def tearDown(self): if not is_pypy: - __feature__.set_selection(0) + feature.reset() qApp.shutdown() # PYSIDE-1019: First property extension was support by the constructor. |
