Packaging cleanup: remove conditionals for < 2.6 support.
PEP 370 features and sys.dont_write_bytecode are always available
in 3.3; the distutils2 backport still has the conditionals.
I also renamed an internal misnamed method and fixed a few things
(“packaging2” name, stray print, unused import, fd leak).
diff --git a/Lib/packaging/tests/test_command_install_dist.py b/Lib/packaging/tests/test_command_install_dist.py
index 8f90aff..808b568 100644
--- a/Lib/packaging/tests/test_command_install_dist.py
+++ b/Lib/packaging/tests/test_command_install_dist.py
@@ -72,7 +72,6 @@
check_path(cmd.install_scripts, os.path.join(destination, "bin"))
check_path(cmd.install_data, destination)
- @unittest.skipIf(sys.version < '2.6', 'requires Python 2.6 or higher')
def test_user_site(self):
# test install with --user
# preparing the environment for the test
@@ -173,12 +172,11 @@
cmd.home = 'home'
self.assertRaises(PackagingOptionError, cmd.finalize_options)
- if sys.version >= '2.6':
- # can't combine user with with prefix/exec_prefix/home or
- # install_(plat)base
- cmd.prefix = None
- cmd.user = 'user'
- self.assertRaises(PackagingOptionError, cmd.finalize_options)
+ # can't combine user with with prefix/exec_prefix/home or
+ # install_(plat)base
+ cmd.prefix = None
+ cmd.user = 'user'
+ self.assertRaises(PackagingOptionError, cmd.finalize_options)
def test_old_record(self):
# test pre-PEP 376 --record option (outside dist-info dir)