Skip to content

Commit b8d50cf

Browse files
committed
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.
1 parent bb74e2a commit b8d50cf

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

setuptools/command/__init__.py

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,11 @@
22
import sys
33

44
if 'egg' not in bdist.format_commands:
5-
bdist.format_command['egg'] = ('bdist_egg', "Python .egg file")
6-
bdist.format_commands.append('egg')
5+
try:
6+
bdist.format_commands['egg'] = ('bdist_egg', "Python .egg file")
7+
except TypeError:
8+
# For backward compatibility with older distutils (stdlib)
9+
bdist.format_command['egg'] = ('bdist_egg', "Python .egg file")
10+
bdist.format_commands.append('egg')
711

812
del bdist, sys

0 commit comments

Comments
 (0)