changeset: 92587:7230978647a8 parent: 92585:45e1c0029aff user: Yury Selivanov date: Fri Sep 26 12:33:06 2014 -0400 files: Lib/os.py Lib/test/test_os.py Misc/NEWS description: os: Include posix functions in os.__all__. Closes issue #18554. Patch by Ronald Oussoren. diff -r 45e1c0029aff -r 7230978647a8 Lib/os.py --- a/Lib/os.py Fri Sep 26 15:35:02 2014 +0300 +++ b/Lib/os.py Fri Sep 26 12:33:06 2014 -0400 @@ -61,6 +61,10 @@ except ImportError: pass + import posix + __all__.extend(_get_exports_list(posix)) + del posix + elif 'nt' in _names: name = 'nt' linesep = '\r\n' diff -r 45e1c0029aff -r 7230978647a8 Lib/test/test_os.py --- a/Lib/test/test_os.py Fri Sep 26 15:35:02 2014 +0300 +++ b/Lib/test/test_os.py Fri Sep 26 12:33:06 2014 -0400 @@ -2616,6 +2616,13 @@ 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 @@ FDInheritanceTests, Win32JunctionTests, BlockingTests, + ExportsTests, ) if __name__ == "__main__": diff -r 45e1c0029aff -r 7230978647a8 Misc/NEWS --- a/Misc/NEWS Fri Sep 26 15:35:02 2014 +0300 +++ b/Misc/NEWS Fri Sep 26 12:33:06 2014 -0400 @@ -10,6 +10,8 @@ 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