__init__.py 803 B

123456789101112131415161718192021
  1. # mypy: disable_error_code=call-overload
  2. # pyright: reportCallIssue=false, reportArgumentType=false
  3. # Can't disable on the exact line because distutils doesn't exists on Python 3.12
  4. # and type-checkers aren't aware of distutils_hack,
  5. # causing distutils.command.bdist.bdist.format_commands to be Any.
  6. import sys
  7. from distutils.command.bdist import bdist
  8. if 'egg' not in bdist.format_commands:
  9. try:
  10. # format_commands is a dict in vendored distutils
  11. # It used to be a list in older (stdlib) distutils
  12. # We support both for backwards compatibility
  13. bdist.format_commands['egg'] = ('bdist_egg', "Python .egg file")
  14. except TypeError:
  15. bdist.format_command['egg'] = ('bdist_egg', "Python .egg file")
  16. bdist.format_commands.append('egg')
  17. del bdist, sys