mirror of
https://github.com/python/cpython.git
synced 2025-09-26 18:29:57 +00:00
bpo-35133: Fix mistakes when concatenate string literals on different lines. (GH-10284)
Two kind of mistakes: 1. Missed space. After concatenating there is no space between words. 2. Missed comma. Causes unintentional concatenating in a list of strings.
This commit is contained in:
parent
ad1a25f499
commit
34fd4c2019
26 changed files with 38 additions and 40 deletions
|
@ -2209,8 +2209,8 @@ def get_section(value):
|
||||||
digits += value[0]
|
digits += value[0]
|
||||||
value = value[1:]
|
value = value[1:]
|
||||||
if digits[0] == '0' and digits != '0':
|
if digits[0] == '0' and digits != '0':
|
||||||
section.defects.append(errors.InvalidHeaderError("section number"
|
section.defects.append(errors.InvalidHeaderError(
|
||||||
"has an invalid leading 0"))
|
"section number has an invalid leading 0"))
|
||||||
section.number = int(digits)
|
section.number = int(digits)
|
||||||
section.append(ValueTerminal(digits, 'digits'))
|
section.append(ValueTerminal(digits, 'digits'))
|
||||||
return section, value
|
return section, value
|
||||||
|
|
|
@ -335,7 +335,7 @@ ViewWindow_spec = {
|
||||||
_widget_redirector_spec = {
|
_widget_redirector_spec = {
|
||||||
'file': 'redirector',
|
'file': 'redirector',
|
||||||
'kwds': {},
|
'kwds': {},
|
||||||
'msg': "Every text insert should be printed to the console."
|
'msg': "Every text insert should be printed to the console "
|
||||||
"or the IDLE shell."
|
"or the IDLE shell."
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -1607,7 +1607,7 @@ class TestBreakpoint(unittest.TestCase):
|
||||||
@unittest.skipIf(sys.flags.ignore_environment, '-E was given')
|
@unittest.skipIf(sys.flags.ignore_environment, '-E was given')
|
||||||
def test_envar_unimportable(self):
|
def test_envar_unimportable(self):
|
||||||
for envar in (
|
for envar in (
|
||||||
'.', '..', '.foo', 'foo.', '.int', 'int.'
|
'.', '..', '.foo', 'foo.', '.int', 'int.',
|
||||||
'nosuchbuiltin',
|
'nosuchbuiltin',
|
||||||
'nosuchmodule.nosuchcallable',
|
'nosuchmodule.nosuchcallable',
|
||||||
):
|
):
|
||||||
|
|
|
@ -285,7 +285,7 @@ if 1:
|
||||||
'from sys import stdin)',
|
'from sys import stdin)',
|
||||||
'from sys import stdin, stdout,\nstderr',
|
'from sys import stdin, stdout,\nstderr',
|
||||||
'from sys import stdin si',
|
'from sys import stdin si',
|
||||||
'from sys import stdin,'
|
'from sys import stdin,',
|
||||||
'from sys import (*)',
|
'from sys import (*)',
|
||||||
'from sys import (stdin,, stdout, stderr)',
|
'from sys import (stdin,, stdout, stderr)',
|
||||||
'from sys import (stdin, stdout),',
|
'from sys import (stdin, stdout),',
|
||||||
|
|
|
@ -174,12 +174,10 @@ class DateTimeTests(unittest.TestCase):
|
||||||
'1980-01-01 00:61:00',
|
'1980-01-01 00:61:00',
|
||||||
'01-01-1980 00:00:62',
|
'01-01-1980 00:00:62',
|
||||||
'01-01-1980T00:00:62',
|
'01-01-1980T00:00:62',
|
||||||
'19800101T250000Z'
|
'19800101T250000Z',
|
||||||
'1980-01-01 00:00:00 -2500',
|
|
||||||
]:
|
]:
|
||||||
self.assertIsNone(iso2time(test),
|
self.assertIsNone(iso2time(test),
|
||||||
"iso2time(%s) is not None\n"
|
"iso2time(%r)" % test)
|
||||||
"iso2time(test) %s" % (test, iso2time(test)))
|
|
||||||
|
|
||||||
|
|
||||||
class HeaderTests(unittest.TestCase):
|
class HeaderTests(unittest.TestCase):
|
||||||
|
|
|
@ -1772,7 +1772,7 @@ _all_magics = _magics | _non_defaults
|
||||||
|
|
||||||
_unsupported_magics = {
|
_unsupported_magics = {
|
||||||
'__getattr__', '__setattr__',
|
'__getattr__', '__setattr__',
|
||||||
'__init__', '__new__', '__prepare__'
|
'__init__', '__new__', '__prepare__',
|
||||||
'__instancecheck__', '__subclasscheck__',
|
'__instancecheck__', '__subclasscheck__',
|
||||||
'__del__'
|
'__del__'
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue