bdist_wininst.py 922 B

123456789101112131415161718192021222324252627282930
  1. import distutils.command.bdist_wininst as orig
  2. import warnings
  3. from setuptools import SetuptoolsDeprecationWarning
  4. class bdist_wininst(orig.bdist_wininst):
  5. def reinitialize_command(self, command, reinit_subcommands=0):
  6. """
  7. Supplement reinitialize_command to work around
  8. http://bugs.python.org/issue20819
  9. """
  10. cmd = self.distribution.reinitialize_command(
  11. command, reinit_subcommands)
  12. if command in ('install', 'install_lib'):
  13. cmd.install_lib = None
  14. return cmd
  15. def run(self):
  16. warnings.warn(
  17. "bdist_wininst is deprecated and will be removed in a future "
  18. "version. Use bdist_wheel (wheel packages) instead.",
  19. SetuptoolsDeprecationWarning
  20. )
  21. self._is_running = True
  22. try:
  23. orig.bdist_wininst.run(self)
  24. finally:
  25. self._is_running = False