diff options
author | Christian Tismer <tismer@stackless.com> | 2017-12-01 16:53:58 +0100 |
---|---|---|
committer | Christian Tismer <tismer@stackless.com> | 2017-12-05 11:32:45 +0000 |
commit | 4f11db4232d7ce5ac415d36d86fbf6e92f6e88a1 (patch) | |
tree | 96177d96ad705ceb9d88c7ece52413182a58be3e /sources/pyside2/tests/registry/signature_test.py | |
parent | 4379a97592fb282c6e6acc9185a68953e7c46e3d (diff) |
Unify signature registry for py2 / py3 and clean up
It turned out that there are tiny differences between Python2 and Python3
which make the versions of the registry almost, but not totally equal.
There are functions which are slot wrappers in Python2 instead of
method wrappers in Python3, and we currently don't support slot wrappers.
There are other tiny differences when we switch to Qt 5.9, too.
Initially, I thought to split the files for Python2 and Python3, but then
it turned out that the problems vanish when we ignore the 'next' and '__next__'
functions in both python versions.
The filter function is both applied to the generating function and the testing
function. Therefore we can keep the existing data intact.
I further removed an indentation leftover in cppgenerator.cpp,
fixed handling of duplicate entries and improved modularisation of the
signature enumerator and formatter. This part will later be moved into the signature
library.
Task-number: PYSIDE-510
Change-Id: I18f5e8f08fb9b07534003919abe55ab4dafeb2c2
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
Diffstat (limited to 'sources/pyside2/tests/registry/signature_test.py')
-rw-r--r-- | sources/pyside2/tests/registry/signature_test.py | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/sources/pyside2/tests/registry/signature_test.py b/sources/pyside2/tests/registry/signature_test.py index 949244dc3..105f46e15 100644 --- a/sources/pyside2/tests/registry/signature_test.py +++ b/sources/pyside2/tests/registry/signature_test.py @@ -85,9 +85,9 @@ def enum_module(mod_name): else: dprint(" def __init__" + str(signature)) count += 1 - class_members = list(klass.__dict__.items()) have_sig = signature is not None have_members = 0 + class_members = sorted(list(klass.__dict__.items())) for func_name, func in class_members: signature = getattr(func, '__signature__', None) if signature is not None: @@ -110,8 +110,9 @@ def enum_all(): for mod_name in all_modules: result[mod_name] = enum_module(mod_name) total += result[mod_name] - pprint(result if sys.version_info >= (3,) else list(result.items())) - print("Total", total) + pprint(result if sys.version_info >= (3,) else list(result.items()), + stream=sys.stderr) + print("Total", total, file=sys.stderr) return result |