diff --git a/src/trio/_tests/test_exports.py b/src/trio/_tests/test_exports.py index b9a5d51cf..aa99111ff 100644 --- a/src/trio/_tests/test_exports.py +++ b/src/trio/_tests/test_exports.py @@ -346,6 +346,12 @@ def lookup_symbol(symbol: str) -> dict[str, str]: "__deepcopy__", } + if type(class_) == type: + # C extension classes don't have these dunders, but Python classes do + ignore_names.add("__firstlineno__") + ignore_names.add("__static_attributes__") + + # pypy seems to have some additional dunders that differ if sys.implementation.name == "pypy": ignore_names |= { @@ -401,15 +407,6 @@ def lookup_symbol(symbol: str) -> dict[str, str]: # using .remove() instead of .delete() to get an error in case they start not # being missing - if sys.version_info >= (3, 13): - try: - missing.remove("__firstlineno__") - missing.remove("__static_attributes__") - except: - print(f"FAILED: {class_}; {static_names}") - else: - print(f"SUCCESS: {class_}") - if ( tool == "jedi" and BaseException in class_.__mro__