summaryrefslogtreecommitdiff
path: root/setuptools/command/__init__.py
diff options
context:
space:
mode:
authorJason R. Coombs <jaraco@jaraco.com>2022-07-31 14:59:16 -0400
committerJason R. Coombs <jaraco@jaraco.com>2022-07-31 14:59:16 -0400
commitb8d50cf4f7431ed617957e7d6e432a1729656524 (patch)
treefe8ed930399e3cc56f51903b8e07772372e63e9f /setuptools/command/__init__.py
parentbb74e2aa7c968e15bd3e3072761cab9b78211731 (diff)
downloadpython-setuptools-git-b8d50cf4f7431ed617957e7d6e432a1729656524.tar.gz
Update 'bdist' format addition to assume a single 'format_commands' as a dictionary, but fall back to the dual dict/list model for compatibility with stdlib.
Diffstat (limited to 'setuptools/command/__init__.py')
-rw-r--r--setuptools/command/__init__.py8
1 files changed, 6 insertions, 2 deletions
diff --git a/setuptools/command/__init__.py b/setuptools/command/__init__.py
index b966dcea..5acd7687 100644
--- a/setuptools/command/__init__.py
+++ b/setuptools/command/__init__.py
@@ -2,7 +2,11 @@ from distutils.command.bdist import bdist
import sys
if 'egg' not in bdist.format_commands:
- bdist.format_command['egg'] = ('bdist_egg', "Python .egg file")
- bdist.format_commands.append('egg')
+ try:
+ bdist.format_commands['egg'] = ('bdist_egg', "Python .egg file")
+ except TypeError:
+ # For backward compatibility with older distutils (stdlib)
+ bdist.format_command['egg'] = ('bdist_egg', "Python .egg file")
+ bdist.format_commands.append('egg')
del bdist, sys