]> git.ipfire.org Git - thirdparty/Python/cpython.git/commitdiff
[2.7] bpo-35133: Fix mistakes when concatenate string literals on different lines...
authorSerhiy Storchaka <storchaka@gmail.com>
Mon, 5 Nov 2018 16:16:26 +0000 (18:16 +0200)
committerGitHub <noreply@github.com>
Mon, 5 Nov 2018 16:16:26 +0000 (18:16 +0200)
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.
(cherry picked from commit 34fd4c20198dea6ab2fe8dc6d32d744d9bde868d)
(cherry picked from commit 7054e5c80b6e98cd44e22d1bc2d7f0a94343089d)

15 files changed:
Lib/decimal.py
Lib/distutils/command/bdist_dumb.py
Lib/distutils/command/bdist_msi.py
Lib/distutils/command/bdist_rpm.py
Lib/distutils/command/bdist_wininst.py
Lib/distutils/command/build_ext.py
Lib/idlelib/HyperParser.py
Lib/idlelib/idle_test/htest.py
Lib/idlelib/idle_test/mock_tk.py
Lib/test/test_compile.py
Lib/test/test_decimal.py
Lib/test/test_strptime.py
Lib/trace.py
Python/import.c
Tools/scripts/texi2html.py

index e5329dde494652faacff2eba11e695876aaae1aa..220fa57ac5be916cc395967904bcb53031d97333 100644 (file)
@@ -1909,7 +1909,7 @@ class Decimal(object):
         if not other and not self:
             return context._raise_error(InvalidOperation,
                                         'at least one of pow() 1st argument '
-                                        'and 2nd argument must be nonzero ;'
+                                        'and 2nd argument must be nonzero'
                                         '0**0 is not defined')
 
         # compute sign of result
index 2f3c66829a1bc7c5c4d1aaf9ad893146d4cae6fb..d8e023dd0584491c34c9fd72e26eee1fcfcd9c03 100644 (file)
@@ -35,7 +35,7 @@ class bdist_dumb (Command):
                     ('skip-build', None,
                      "skip rebuilding everything (for testing/debugging)"),
                     ('relative', None,
-                     "build the archive using relative paths"
+                     "build the archive using relative paths "
                      "(default: false)"),
                     ('owner=', 'u',
                      "Owner name used when creating a tar file"
index 703f873b164e895988ef100de8561ed7dd7e6f41..d2401bc4736af9251dd46cf8abf7356bc7bfdadc 100644 (file)
@@ -99,14 +99,14 @@ class bdist_msi (Command):
                     ('no-target-compile', 'c',
                      "do not compile .py to .pyc on the target system"),
                     ('no-target-optimize', 'o',
-                     "do not compile .py to .pyo (optimized)"
+                     "do not compile .py to .pyo (optimized) "
                      "on the target system"),
                     ('dist-dir=', 'd',
                      "directory to put final built distributions in"),
                     ('skip-build', None,
                      "skip rebuilding everything (for testing/debugging)"),
                     ('install-script=', None,
-                     "basename of installation script to be run after"
+                     "basename of installation script to be run after "
                      "installation or before deinstallation"),
                     ('pre-install-script=', None,
                      "Fully qualified filename of a script to be run before "
index 477e0ee064b7617099170406e2d3f1c165f68559..caadf489a938d84d8d3dee67a7696cc2fc13bf3e 100644 (file)
@@ -63,7 +63,7 @@ class bdist_rpm (Command):
          "RPM \"vendor\" (eg. \"Joe Blow <joe@example.com>\") "
          "[default: maintainer or author from setup script]"),
         ('packager=', None,
-         "RPM packager (eg. \"Jane Doe <jane@example.net>\")"
+         "RPM packager (eg. \"Jane Doe <jane@example.net>\") "
          "[default: vendor]"),
         ('doc-files=', None,
          "list of documentation files (space or comma-separated)"),
index aa9383af98b641fd5041aacbd1c2d142b434deb7..a1de520276811082afecfb7b5b958aff249d2883 100644 (file)
@@ -35,7 +35,7 @@ class bdist_wininst (Command):
                     ('no-target-compile', 'c',
                      "do not compile .py to .pyc on the target system"),
                     ('no-target-optimize', 'o',
-                     "do not compile .py to .pyo (optimized)"
+                     "do not compile .py to .pyo (optimized) "
                      "on the target system"),
                     ('dist-dir=', 'd',
                      "directory to put final built distributions in"),
@@ -46,7 +46,7 @@ class bdist_wininst (Command):
                     ('skip-build', None,
                      "skip rebuilding everything (for testing/debugging)"),
                     ('install-script=', None,
-                     "basename of installation script to be run after"
+                     "basename of installation script to be run after "
                      "installation or before deinstallation"),
                     ('pre-install-script=', None,
                      "Fully qualified filename of a script to be run before "
index 2c68be39cdf60fec3eeb735c8f0f4c7001c6243a..86a85c1a0a01dad7e45679fce2a300213c23d22a 100644 (file)
@@ -366,7 +366,7 @@ class build_ext (Command):
             ext_name, build_info = ext
 
             log.warn(("old-style (ext_name, build_info) tuple found in "
-                      "ext_modules for extension '%s'"
+                      "ext_modules for extension '%s' "
                       "-- please convert to Extension instance" % ext_name))
 
             if not (isinstance(ext_name, str) and
index 5816d00f45c8f4261bf35f8aa699750c82d02b4f..6e45b161a46dab50c49fa0759f570a9f9a864b42 100644 (file)
@@ -167,7 +167,7 @@ class HyperParser:
         given index, which is empty if there is no real one.
         """
         if not self.is_in_code():
-            raise ValueError("get_expression should only be called"
+            raise ValueError("get_expression should only be called "
                              "if index is inside a code.")
 
         rawtext = self.rawtext
index f34140921c81f42602a4214e82baa4b4c0f34465..9e2ddd2c19e0fd2abfee7c6276087d86f18b346b 100644 (file)
@@ -112,7 +112,7 @@ ConfigDialog_spec = {
            "font face of the text in the area below it.\nIn the "
            "'Highlighting' tab, try different color schemes. Clicking "
            "items in the sample program should update the choices above it."
-           "\nIn the 'Keys', 'General' and 'Extensions' tabs, test settings"
+           "\nIn the 'Keys', 'General' and 'Extensions' tabs, test settings "
            "of interest."
            "\n[Ok] to close the dialog.[Apply] to apply the settings and "
            "and [Cancel] to revert all changes.\nRe-run the test to ensure "
@@ -171,7 +171,7 @@ GetKeysDialog_spec = {
     'msg': "Test for different key modifier sequences.\n"
            "<nothing> is invalid.\n"
            "No modifier key is invalid.\n"
-           "Shift key with [a-z],[0-9], function key, move key, tab, space"
+           "Shift key with [a-z],[0-9], function key, move key, tab, space "
            "is invalid.\nNo validitity checking if advanced key binding "
            "entry is used."
     }
@@ -237,7 +237,7 @@ _percolator_spec = {
     'file': 'Percolator',
     'kwds': {},
     'msg': "There are two tracers which can be toggled using a checkbox.\n"
-           "Toggling a tracer 'on' by checking it should print tracer"
+           "Toggling a tracer 'on' by checking it should print tracer "
            "output to the console or to the IDLE shell.\n"
            "If both the tracers are 'on', the output from the tracer which "
            "was switched 'on' later, should be printed first\n"
@@ -329,7 +329,7 @@ _undo_delegator_spec = {
 _widget_redirector_spec = {
     'file': 'WidgetRedirector',
     '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."
     }
 
index f42a039711b46fb1962f374eb42eb455025b312e..56ca87695af6db353700090f7f3184369de09a4a 100644 (file)
@@ -260,7 +260,7 @@ class Text(object):
         elif op == '!=':
             return line1 != line2 or  char1 != char2
         else:
-            raise TclError('''bad comparison operator "%s":'''
+            raise TclError('''bad comparison operator "%s": '''
                                   '''must be <, <=, ==, >=, >, or !=''' % op)
 
     # The following Text methods normally do something and return None.
index e954a0ce746190c043e1d112e0fbfb35a8a6afd3..15a00f3cf7fcfe8548c244870ca3d19dc985d0ee 100644 (file)
@@ -392,7 +392,7 @@ if 1:
             'from sys import stdin)',
             'from sys import stdin, stdout,\nstderr',
             'from sys import stdin si',
-            'from sys import stdin,'
+            'from sys import stdin,',
             'from sys import (*)',
             'from sys import (stdin,, stdout, stderr)',
             'from sys import (stdin, stdout),',
index 14b7f42f56275c9020a2017afd3d77a52c0dad8c..f481075cee25c21fe2cc00c631dfe8921e2f927d 100644 (file)
@@ -914,10 +914,10 @@ class DecimalFormatTest(unittest.TestCase):
         decimal_point = locale.localeconv()['decimal_point']
         thousands_sep = locale.localeconv()['thousands_sep']
         if decimal_point != '\xd9\xab':
-            self.skipTest('inappropriate decimal point separator'
+            self.skipTest('inappropriate decimal point separator '
                           '({!r} not {!r})'.format(decimal_point, '\xd9\xab'))
         if thousands_sep != '\xd9\xac':
-            self.skipTest('inappropriate thousands separator'
+            self.skipTest('inappropriate thousands separator '
                           '({!r} not {!r})'.format(thousands_sep, '\xd9\xac'))
 
         self.assertEqual(format(Decimal('100000000.123'), 'n'),
index 3d249419517a446c1472ab2f0ec0c55c5cc63ea7..48ad5daec402cb2d3873d6da11a93c11e6784551 100644 (file)
@@ -428,7 +428,7 @@ class CalculationTests(unittest.TestCase):
         self.assertTrue(result.tm_year == self.time_tuple.tm_year and
                          result.tm_mon == self.time_tuple.tm_mon and
                          result.tm_mday == self.time_tuple.tm_mday,
-                        "Calculation of Gregorian date failed;"
+                        "Calculation of Gregorian date failed; "
                          "%s-%s-%s != %s-%s-%s" %
                          (result.tm_year, result.tm_mon, result.tm_mday,
                           self.time_tuple.tm_year, self.time_tuple.tm_mon,
@@ -440,7 +440,7 @@ class CalculationTests(unittest.TestCase):
         result = _strptime._strptime_time(time.strftime(format_string, self.time_tuple),
                                     format_string)
         self.assertTrue(result.tm_wday == self.time_tuple.tm_wday,
-                        "Calculation of day of the week failed;"
+                        "Calculation of day of the week failed; "
                          "%s != %s" % (result.tm_wday, self.time_tuple.tm_wday))
 
     def test_week_of_year_and_day_of_week_calculation(self):
index 38a13e2a9f0fa92ddcfec3c92022c355a3a4a943..96af2603540ece73c22554d2b09494a0d21a8303 100755 (executable)
@@ -360,7 +360,7 @@ class CoverageResults:
         try:
             outfile = open(path, "w")
         except IOError, err:
-            print >> sys.stderr, ("trace: Could not open %r for writing: %s"
+            print >> sys.stderr, ("trace: Could not open %r for writing: %s "
                                   "- skipping" % (path, err))
             return 0, 0
 
index f43a47c1c4720142c74aa8ffe6641ae97642b17d..ccbd949e624f149fbb5aadbf568b5727ef0e4fad 100644 (file)
@@ -701,7 +701,7 @@ remove_module(const char *name)
     if (PyDict_GetItemString(modules, name) == NULL)
         return;
     if (PyDict_DelItemString(modules, name) < 0)
-        Py_FatalError("import:  deleting existing key in"
+        Py_FatalError("import:  deleting existing key in "
                       "sys.modules failed");
 }
 
index 57db166df1e11db749c742762cc98c809947cb5c..fbf32d608b8dac56a4a1d68b28a92ad7957bf9cb 100755 (executable)
@@ -1808,7 +1808,7 @@ class HTMLHelp:
             print>>fp, '<!-- This file defines the table of contents -->'
             print>>fp, '<HTML>'
             print>>fp, '<HEAD>'
-            print>>fp, ('<meta name="GENERATOR"'
+            print>>fp, ('<meta name="GENERATOR" '
                         'content="Microsoft&reg; HTML Help Workshop 4.1">')
             print>>fp, '<!-- Sitemap 1.0 -->'
             print>>fp, '</HEAD>'
@@ -1833,7 +1833,7 @@ class HTMLHelp:
             print>>fp, '<!-- This file defines the index -->'
             print>>fp, '<HTML>'
             print>>fp, '<HEAD>'
-            print>>fp, ('<meta name="GENERATOR"'
+            print>>fp, ('<meta name="GENERATOR" '
                         'content="Microsoft&reg; HTML Help Workshop 4.1">')
             print>>fp, '<!-- Sitemap 1.0 -->'
             print>>fp, '</HEAD>'