]> git.ipfire.org Git - thirdparty/Python/cpython.git/commitdiff
os: Include posix functions in os.__all__. Closes issue #18554.
authorYury Selivanov <yselivanov@sprymix.com>
Fri, 26 Sep 2014 16:33:06 +0000 (12:33 -0400)
committerYury Selivanov <yselivanov@sprymix.com>
Fri, 26 Sep 2014 16:33:06 +0000 (12:33 -0400)
Patch by Ronald Oussoren.

Lib/os.py
Lib/test/test_os.py
Misc/NEWS

index 556f592526a668392d23169d3015f52e7e6f56a7..3bb0f4e2503199372842a2e969c4e7777072d68b 100644 (file)
--- a/Lib/os.py
+++ b/Lib/os.py
@@ -61,6 +61,10 @@ if 'posix' in _names:
     except ImportError:
         pass
 
+    import posix
+    __all__.extend(_get_exports_list(posix))
+    del posix
+
 elif 'nt' in _names:
     name = 'nt'
     linesep = '\r\n'
index 020d0fa41f1a8515f7bfa211006ffdf91a10843e..62815965e8b39ed1e8edf4f5e07488924384ed0d 100644 (file)
@@ -2616,6 +2616,13 @@ class BlockingTests(unittest.TestCase):
         self.assertEqual(os.get_blocking(fd), True)
 
 
+
+class ExportsTests(unittest.TestCase):
+    def test_os_all(self):
+        self.assertIn('open', os.__all__)
+        self.assertIn('walk', os.__all__)
+
+
 @support.reap_threads
 def test_main():
     support.run_unittest(
@@ -2652,6 +2659,7 @@ def test_main():
         FDInheritanceTests,
         Win32JunctionTests,
         BlockingTests,
+        ExportsTests,
     )
 
 if __name__ == "__main__":
index 9cb9e23e18ef65acd28755191cab2e28edbb1026..fb018be21a87ce545cf00f47c02d4a0cd4434890 100644 (file)
--- a/Misc/NEWS
+++ b/Misc/NEWS
@@ -10,6 +10,8 @@ Release date: TBA
 Core and Builtins
 -----------------
 
+- Issue #18554: os.__all__ includes posix functions.
+
 - Issue #21391: Use os.path.abspath in the shutil module.
 
 - Issue #11471: avoid generating a JUMP_FORWARD instruction at the end of