diff options
Diffstat (limited to 'Lib/packaging/tests/test_command_build_py.py')
-rw-r--r-- | Lib/packaging/tests/test_command_build_py.py | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/Lib/packaging/tests/test_command_build_py.py b/Lib/packaging/tests/test_command_build_py.py index b6d60de..49069f5 100644 --- a/Lib/packaging/tests/test_command_build_py.py +++ b/Lib/packaging/tests/test_command_build_py.py @@ -61,9 +61,12 @@ class BuildPyTestCase(support.TempdirManager, pkgdest = os.path.join(destination, "pkg") files = os.listdir(pkgdest) self.assertIn("__init__.py", files) - if not sys.dont_write_bytecode: - self.assertIn("__init__.pyc", files) self.assertIn("README.txt", files) + # XXX even with -O, distutils writes pyc, not pyo; bug? + if sys.dont_write_bytecode: + self.assertNotIn("__init__.pyc", files) + else: + self.assertIn("__init__.pyc", files) def test_empty_package_dir(self): # See SF 1668596/1720897. @@ -93,7 +96,7 @@ class BuildPyTestCase(support.TempdirManager, try: dist.run_commands() - except PackagingFileError as e: + except PackagingFileError: self.fail("failed package_data test when package_dir is ''") finally: # Restore state. |