mirror of
https://github.com/python/cpython.git
synced 2025-12-08 06:10:17 +00:00
[3.10] bpo-27718: Fix help for the signal module (GH-30063) (GH-30080)
Functions signal(), getsignal(), pthread_sigmask(), sigpending(),
sigwait() and valid_signals() were omitted.
If __all__ is not defined all non-builtin functions should have
correct __module__.
(cherry picked from commit e08c0d8eec)
This commit is contained in:
parent
7da90251ae
commit
e55deaabd8
3 changed files with 21 additions and 3 deletions
|
|
@ -1,4 +1,5 @@
|
|||
import errno
|
||||
import inspect
|
||||
import os
|
||||
import random
|
||||
import signal
|
||||
|
|
@ -33,6 +34,14 @@ def test_enums(self):
|
|||
self.assertIsInstance(sig, signal.Signals)
|
||||
self.assertEqual(sys.platform, "win32")
|
||||
|
||||
def test_functions_module_attr(self):
|
||||
# Issue #27718: If __all__ is not defined all non-builtin functions
|
||||
# should have correct __module__ to be displayed by pydoc.
|
||||
for name in dir(signal):
|
||||
value = getattr(signal, name)
|
||||
if inspect.isroutine(value) and not inspect.isbuiltin(value):
|
||||
self.assertEqual(value.__module__, 'signal')
|
||||
|
||||
|
||||
@unittest.skipIf(sys.platform == "win32", "Not valid on Windows")
|
||||
class PosixTests(unittest.TestCase):
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue