Commit e4bbea8
committed
Fix test_sys_module_has_signatures: METH_NOARGS never has None text signature
METH_NOARGS functions always produce '($self, /)' as their __text_signature__
via signature_from_flags() in Objects/typeobject.c, not None. Placing
sys.__dir__ in the no_signature set (which assertIsNone(__text_signature__))
therefore always fails.
Remove '__dir__' from no_signature. Since __dir__ is non-public (starts with
'__') it is not included in the is_public() filter, so no assertion is made
about it in the supported-signatures loop either. The '($self, /)' signature
returned by inspect.signature(sys.__dir__) (empty visible params) is correct.
sys.__getattr__ stays in no_signature: METH_VARARGS has no fallback in
signature_from_flags() so its __text_signature__ is genuinely None.1 parent 46c6033 commit e4bbea8
1 file changed
Lines changed: 5 additions & 3 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
6179 | 6179 | | |
6180 | 6180 | | |
6181 | 6181 | | |
6182 | | - | |
6183 | | - | |
6184 | | - | |
| 6182 | + | |
| 6183 | + | |
| 6184 | + | |
| 6185 | + | |
| 6186 | + | |
6185 | 6187 | | |
6186 | 6188 | | |
6187 | 6189 | | |
| |||
0 commit comments