mirror of
https://github.com/python/cpython.git
synced 2025-09-16 21:56:14 +00:00
fixed #4646 : distutils was choking on empty options arg in the setup function.
This commit is contained in:
parent
fc5a8543ce
commit
c13acb18bc
3 changed files with 28 additions and 1 deletions
|
@ -235,7 +235,7 @@ Common commands: (see '--help-commands' for more)
|
||||||
# command options will override any supplied redundantly
|
# command options will override any supplied redundantly
|
||||||
# through the general options dictionary.
|
# through the general options dictionary.
|
||||||
options = attrs.get('options')
|
options = attrs.get('options')
|
||||||
if options:
|
if options is not None:
|
||||||
del attrs['options']
|
del attrs['options']
|
||||||
for (command, cmd_options) in options.items():
|
for (command, cmd_options) in options.items():
|
||||||
opt_dict = self.get_option_dict(command)
|
opt_dict = self.get_option_dict(command)
|
||||||
|
|
|
@ -8,6 +8,7 @@ import os
|
||||||
import StringIO
|
import StringIO
|
||||||
import sys
|
import sys
|
||||||
import unittest
|
import unittest
|
||||||
|
import warnings
|
||||||
|
|
||||||
from test.test_support import TESTFN
|
from test.test_support import TESTFN
|
||||||
|
|
||||||
|
@ -131,6 +132,29 @@ class DistributionTestCase(unittest.TestCase):
|
||||||
if os.path.exists(my_file):
|
if os.path.exists(my_file):
|
||||||
os.remove(my_file)
|
os.remove(my_file)
|
||||||
|
|
||||||
|
def test_empty_options(self):
|
||||||
|
# an empty options dictionary should not stay in the
|
||||||
|
# list of attributes
|
||||||
|
klass = distutils.dist.Distribution
|
||||||
|
|
||||||
|
# catching warnings
|
||||||
|
warns = []
|
||||||
|
def _warn(msg):
|
||||||
|
warns.append(msg)
|
||||||
|
|
||||||
|
old_warn = warnings.warn
|
||||||
|
warnings.warn = _warn
|
||||||
|
try:
|
||||||
|
dist = klass(attrs={'author': 'xxx',
|
||||||
|
'name': 'xxx',
|
||||||
|
'version': 'xxx',
|
||||||
|
'url': 'xxxx',
|
||||||
|
'options': {}})
|
||||||
|
finally:
|
||||||
|
warnings.warn = old_warn
|
||||||
|
|
||||||
|
self.assertEquals(len(warns), 0)
|
||||||
|
|
||||||
class MetadataTestCase(unittest.TestCase):
|
class MetadataTestCase(unittest.TestCase):
|
||||||
|
|
||||||
def test_simple_metadata(self):
|
def test_simple_metadata(self):
|
||||||
|
|
|
@ -97,6 +97,9 @@ Core and Builtins
|
||||||
Library
|
Library
|
||||||
-------
|
-------
|
||||||
|
|
||||||
|
- Issue #4646: distutils was choking on empty options arg in the setup
|
||||||
|
function. Original patch by Thomas Heller.
|
||||||
|
|
||||||
- Issue #3767: Convert Tk object to string in tkColorChooser.
|
- Issue #3767: Convert Tk object to string in tkColorChooser.
|
||||||
|
|
||||||
- Issue #3248: Allow placing ScrolledText in a PanedWindow.
|
- Issue #3248: Allow placing ScrolledText in a PanedWindow.
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue