Skip to content

Commit

Permalink
Fix cross-python version issue
Browse files Browse the repository at this point in the history
  • Loading branch information
Avasam committed Oct 17, 2024
1 parent 0efd757 commit 62b63c4
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion setuptools/command/__init__.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,9 @@
# mypy: disable_error_code=call-overload
# pyright: reportCallIssue=false, reportArgumentType=false
# Can't disable on the exact line because distutils doesn't exists on Python 3.12
# and type-checkers aren't aware of distutils_hack,
# causing distutils.command.bdist.bdist.format_commands to be Any.

import sys

from distutils.command.bdist import bdist
Expand All @@ -7,7 +13,7 @@
# format_commands is a dict in vendored distutils
# It used to be a list in older (stdlib) distutils
# We support both for backwards compatibility
bdist.format_commands['egg'] = ('bdist_egg', "Python .egg file") # type: ignore[call-overload]
bdist.format_commands['egg'] = ('bdist_egg', "Python .egg file")
except TypeError:
bdist.format_command['egg'] = ('bdist_egg', "Python .egg file")
bdist.format_commands.append('egg')
Expand Down

0 comments on commit 62b63c4

Please sign in to comment.