File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -228,7 +228,7 @@ def __init__ (self, attrs=None):
228228 # command options will override any supplied redundantly
229229 # through the general options dictionary.
230230 options = attrs .get ('options' )
231- if options :
231+ if options is not None :
232232 del attrs ['options' ]
233233 for (command , cmd_options ) in options .items ():
234234 opt_dict = self .get_option_dict (command )
Original file line number Diff line number Diff line change 66import io
77import sys
88import unittest
9+ import warnings
910
1011from test .support import TESTFN
1112
@@ -96,6 +97,29 @@ def test_command_packages_configfile(self):
9697 os .unlink (TESTFN )
9798
9899
100+ def test_empty_options (self ):
101+ # an empty options dictionary should not stay in the
102+ # list of attributes
103+ klass = distutils .dist .Distribution
104+
105+ # catching warnings
106+ warns = []
107+ def _warn (msg ):
108+ warns .append (msg )
109+
110+ old_warn = warnings .warn
111+ warnings .warn = _warn
112+ try :
113+ dist = klass (attrs = {'author' : 'xxx' ,
114+ 'name' : 'xxx' ,
115+ 'version' : 'xxx' ,
116+ 'url' : 'xxxx' ,
117+ 'options' : {}})
118+ finally :
119+ warnings .warn = old_warn
120+
121+ self .assertEquals (len (warns ), 0 )
122+
99123class MetadataTestCase (unittest .TestCase ):
100124
101125 def test_simple_metadata (self ):
Original file line number Diff line number Diff line change @@ -64,6 +64,9 @@ Core and Builtins
6464Library
6565-------
6666
67+ - Issue #4646: distutils was choking on empty options arg in the setup
68+ function. Original patch by Thomas Heller.
69+
6770- Issue #3767: Convert Tk object to string in tkColorChooser.
6871
6972- Issue #3248: Allow placing ScrolledText in a PanedWindow.
You can’t perform that action at this time.
0 commit comments