diff --git a/Lib/encodings/__init__.py b/Lib/encodings/__init__.py index f8d2a2a2c6d..1f469bf7d65 100644 --- a/Lib/encodings/__init__.py +++ b/Lib/encodings/__init__.py @@ -117,9 +117,9 @@ def search_function(encoding): entry = getregentry() if not isinstance(entry, codecs.CodecInfo): if not 4 <= len(entry) <= 7: - raise CodecRegistryError,\ - 'module "%s" (%s) failed to register' % \ - (mod.__name__, mod.__file__) + raise CodecRegistryError,\ + 'module "%s" (%s) failed to register' % \ + (mod.__name__, mod.__file__) if not callable(entry[0]) or \ not callable(entry[1]) or \ (entry[2] is not None and not callable(entry[2])) or \ diff --git a/Lib/encodings/cp037.py b/Lib/encodings/cp037.py index 4700a8c8b83..7e589a92a5f 100644 --- a/Lib/encodings/cp037.py +++ b/Lib/encodings/cp037.py @@ -563,4 +563,3 @@ encoding_map = { 0x00FE: 0x8E, # LATIN SMALL LETTER THORN (ICELANDIC) 0x00FF: 0xDF, # LATIN SMALL LETTER Y WITH DIAERESIS } - diff --git a/Lib/encodings/cp1006.py b/Lib/encodings/cp1006.py index 9813e7e65d9..782996951f8 100644 --- a/Lib/encodings/cp1006.py +++ b/Lib/encodings/cp1006.py @@ -562,4 +562,3 @@ encoding_map = { 0xFEF2: 0xFA, # ARABIC LETTER YEH FINAL FORM 0xFEF3: 0xFB, # ARABIC LETTER YEH INITIAL FORM } - diff --git a/Lib/encodings/cp1026.py b/Lib/encodings/cp1026.py index 7014393f6fa..01c88044d8c 100644 --- a/Lib/encodings/cp1026.py +++ b/Lib/encodings/cp1026.py @@ -563,4 +563,3 @@ encoding_map = { 0x015E: 0x7C, # LATIN CAPITAL LETTER S WITH CEDILLA 0x015F: 0x6A, # LATIN SMALL LETTER S WITH CEDILLA } - diff --git a/Lib/encodings/cp1140.py b/Lib/encodings/cp1140.py index 09b70b2f96f..ac8d41bc7be 100644 --- a/Lib/encodings/cp1140.py +++ b/Lib/encodings/cp1140.py @@ -563,4 +563,3 @@ encoding_map = { 0x00FF: 0xDF, # LATIN SMALL LETTER Y WITH DIAERESIS 0x20AC: 0x9F, # EURO SIGN } - diff --git a/Lib/encodings/cp1250.py b/Lib/encodings/cp1250.py index 8eadbbf4335..6e6f57c05ee 100644 --- a/Lib/encodings/cp1250.py +++ b/Lib/encodings/cp1250.py @@ -558,4 +558,3 @@ encoding_map = { 0x20AC: 0x80, # EURO SIGN 0x2122: 0x99, # TRADE MARK SIGN } - diff --git a/Lib/encodings/cp1251.py b/Lib/encodings/cp1251.py index 517a554760c..ed835fe2562 100644 --- a/Lib/encodings/cp1251.py +++ b/Lib/encodings/cp1251.py @@ -562,4 +562,3 @@ encoding_map = { 0x2116: 0xB9, # NUMERO SIGN 0x2122: 0x99, # TRADE MARK SIGN } - diff --git a/Lib/encodings/cp1252.py b/Lib/encodings/cp1252.py index c6954435fc8..e5b6905eaee 100644 --- a/Lib/encodings/cp1252.py +++ b/Lib/encodings/cp1252.py @@ -558,4 +558,3 @@ encoding_map = { 0x20AC: 0x80, # EURO SIGN 0x2122: 0x99, # TRADE MARK SIGN } - diff --git a/Lib/encodings/cp1253.py b/Lib/encodings/cp1253.py index 693407a1960..3ce70b25d94 100644 --- a/Lib/encodings/cp1253.py +++ b/Lib/encodings/cp1253.py @@ -546,4 +546,3 @@ encoding_map = { 0x20AC: 0x80, # EURO SIGN 0x2122: 0x99, # TRADE MARK SIGN } - diff --git a/Lib/encodings/cp1254.py b/Lib/encodings/cp1254.py index cb71f4b3935..31cd48c1a50 100644 --- a/Lib/encodings/cp1254.py +++ b/Lib/encodings/cp1254.py @@ -556,4 +556,3 @@ encoding_map = { 0x20AC: 0x80, # EURO SIGN 0x2122: 0x99, # TRADE MARK SIGN } - diff --git a/Lib/encodings/cp1255.py b/Lib/encodings/cp1255.py index 376e7973fc9..47c43ce90ae 100644 --- a/Lib/encodings/cp1255.py +++ b/Lib/encodings/cp1255.py @@ -540,4 +540,3 @@ encoding_map = { 0x20AC: 0x80, # EURO SIGN 0x2122: 0x99, # TRADE MARK SIGN } - diff --git a/Lib/encodings/cp1256.py b/Lib/encodings/cp1256.py index bb6895f3943..e90393b6a7f 100644 --- a/Lib/encodings/cp1256.py +++ b/Lib/encodings/cp1256.py @@ -563,4 +563,3 @@ encoding_map = { 0x20AC: 0x80, # EURO SIGN 0x2122: 0x99, # TRADE MARK SIGN } - diff --git a/Lib/encodings/cp1257.py b/Lib/encodings/cp1257.py index 08a3fb9649e..dcc81c09eb7 100644 --- a/Lib/encodings/cp1257.py +++ b/Lib/encodings/cp1257.py @@ -551,4 +551,3 @@ encoding_map = { 0x20AC: 0x80, # EURO SIGN 0x2122: 0x99, # TRADE MARK SIGN } - diff --git a/Lib/encodings/cp1258.py b/Lib/encodings/cp1258.py index eecfcbfd2f0..d4d22712e37 100644 --- a/Lib/encodings/cp1258.py +++ b/Lib/encodings/cp1258.py @@ -554,4 +554,3 @@ encoding_map = { 0x20AC: 0x80, # EURO SIGN 0x2122: 0x99, # TRADE MARK SIGN } - diff --git a/Lib/encodings/cp424.py b/Lib/encodings/cp424.py index 9812ccdbce3..966aecb0991 100644 --- a/Lib/encodings/cp424.py +++ b/Lib/encodings/cp424.py @@ -525,4 +525,3 @@ encoding_map = { 0x05EA: 0x71, # HEBREW LETTER TAV 0x2017: 0x78, # DOUBLE LOW LINE } - diff --git a/Lib/encodings/cp500.py b/Lib/encodings/cp500.py index 5b843d16e4b..83af090700d 100644 --- a/Lib/encodings/cp500.py +++ b/Lib/encodings/cp500.py @@ -563,4 +563,3 @@ encoding_map = { 0x00FE: 0x8E, # LATIN SMALL LETTER THORN (ICELANDIC) 0x00FF: 0xDF, # LATIN SMALL LETTER Y WITH DIAERESIS } - diff --git a/Lib/encodings/cp856.py b/Lib/encodings/cp856.py index 7941b27dbfb..c72fcad9f94 100644 --- a/Lib/encodings/cp856.py +++ b/Lib/encodings/cp856.py @@ -522,4 +522,3 @@ encoding_map = { 0x2593: 0xB2, # DARK SHADE 0x25A0: 0xFE, # BLACK SQUARE } - diff --git a/Lib/encodings/cp874.py b/Lib/encodings/cp874.py index d2de389122e..591e8aa39fa 100644 --- a/Lib/encodings/cp874.py +++ b/Lib/encodings/cp874.py @@ -532,4 +532,3 @@ encoding_map = { 0x2026: 0x85, # HORIZONTAL ELLIPSIS 0x20AC: 0x80, # EURO SIGN } - diff --git a/Lib/encodings/cp875.py b/Lib/encodings/cp875.py index 3f24fd31cc0..879d5a4bc79 100644 --- a/Lib/encodings/cp875.py +++ b/Lib/encodings/cp875.py @@ -557,4 +557,3 @@ encoding_map = { 0x2018: 0xCE, # LEFT SINGLE QUOTATION MARK 0x2019: 0xDE, # RIGHT SINGLE QUOTATION MARK } - diff --git a/Lib/encodings/iso8859_1.py b/Lib/encodings/iso8859_1.py index 8eb98c24ce8..b985585b313 100644 --- a/Lib/encodings/iso8859_1.py +++ b/Lib/encodings/iso8859_1.py @@ -563,4 +563,3 @@ encoding_map = { 0x00FE: 0xFE, # LATIN SMALL LETTER THORN (Icelandic) 0x00FF: 0xFF, # LATIN SMALL LETTER Y WITH DIAERESIS } - diff --git a/Lib/encodings/iso8859_10.py b/Lib/encodings/iso8859_10.py index ff2c6db7458..8588430848d 100644 --- a/Lib/encodings/iso8859_10.py +++ b/Lib/encodings/iso8859_10.py @@ -563,4 +563,3 @@ encoding_map = { 0x017E: 0xBC, # LATIN SMALL LETTER Z WITH CARON 0x2015: 0xBD, # HORIZONTAL BAR } - diff --git a/Lib/encodings/iso8859_11.py b/Lib/encodings/iso8859_11.py index a487291b224..fffe6922ced 100644 --- a/Lib/encodings/iso8859_11.py +++ b/Lib/encodings/iso8859_11.py @@ -555,4 +555,3 @@ encoding_map = { 0x0E5A: 0xFA, # THAI CHARACTER ANGKHANKHU 0x0E5B: 0xFB, # THAI CHARACTER KHOMUT } - diff --git a/Lib/encodings/iso8859_13.py b/Lib/encodings/iso8859_13.py index fc59d045114..a8905806a51 100644 --- a/Lib/encodings/iso8859_13.py +++ b/Lib/encodings/iso8859_13.py @@ -563,4 +563,3 @@ encoding_map = { 0x201D: 0xA1, # RIGHT DOUBLE QUOTATION MARK 0x201E: 0xA5, # DOUBLE LOW-9 QUOTATION MARK } - diff --git a/Lib/encodings/iso8859_14.py b/Lib/encodings/iso8859_14.py index f8d96379023..afa458c9c2e 100644 --- a/Lib/encodings/iso8859_14.py +++ b/Lib/encodings/iso8859_14.py @@ -563,4 +563,3 @@ encoding_map = { 0x1EF2: 0xAC, # LATIN CAPITAL LETTER Y WITH GRAVE 0x1EF3: 0xBC, # LATIN SMALL LETTER Y WITH GRAVE } - diff --git a/Lib/encodings/iso8859_15.py b/Lib/encodings/iso8859_15.py index 5e01238e735..4a8334e9e99 100644 --- a/Lib/encodings/iso8859_15.py +++ b/Lib/encodings/iso8859_15.py @@ -563,4 +563,3 @@ encoding_map = { 0x017E: 0xB8, # LATIN SMALL LETTER Z WITH CARON 0x20AC: 0xA4, # EURO SIGN } - diff --git a/Lib/encodings/iso8859_16.py b/Lib/encodings/iso8859_16.py index 0578a217e38..aeebfb6fde2 100644 --- a/Lib/encodings/iso8859_16.py +++ b/Lib/encodings/iso8859_16.py @@ -563,4 +563,3 @@ encoding_map = { 0x201E: 0xA5, # DOUBLE LOW-9 QUOTATION MARK 0x20AC: 0xA4, # EURO SIGN } - diff --git a/Lib/encodings/iso8859_2.py b/Lib/encodings/iso8859_2.py index 85a5b63306a..845f3227a73 100644 --- a/Lib/encodings/iso8859_2.py +++ b/Lib/encodings/iso8859_2.py @@ -563,4 +563,3 @@ encoding_map = { 0x02DB: 0xB2, # OGONEK 0x02DD: 0xBD, # DOUBLE ACUTE ACCENT } - diff --git a/Lib/encodings/iso8859_3.py b/Lib/encodings/iso8859_3.py index cac335db2b1..fbc87755223 100644 --- a/Lib/encodings/iso8859_3.py +++ b/Lib/encodings/iso8859_3.py @@ -556,4 +556,3 @@ encoding_map = { 0x02D8: 0xA2, # BREVE 0x02D9: 0xFF, # DOT ABOVE } - diff --git a/Lib/encodings/iso8859_4.py b/Lib/encodings/iso8859_4.py index ecd7fb24ccf..e705954ca80 100644 --- a/Lib/encodings/iso8859_4.py +++ b/Lib/encodings/iso8859_4.py @@ -563,4 +563,3 @@ encoding_map = { 0x02D9: 0xFF, # DOT ABOVE 0x02DB: 0xB2, # OGONEK } - diff --git a/Lib/encodings/iso8859_5.py b/Lib/encodings/iso8859_5.py index 4e377df88d6..93a4e90246d 100644 --- a/Lib/encodings/iso8859_5.py +++ b/Lib/encodings/iso8859_5.py @@ -563,4 +563,3 @@ encoding_map = { 0x045F: 0xFF, # CYRILLIC SMALL LETTER DZHE 0x2116: 0xF0, # NUMERO SIGN } - diff --git a/Lib/encodings/iso8859_6.py b/Lib/encodings/iso8859_6.py index ca5b125432a..f911cc41927 100644 --- a/Lib/encodings/iso8859_6.py +++ b/Lib/encodings/iso8859_6.py @@ -518,4 +518,3 @@ encoding_map = { 0x0651: 0xF1, # ARABIC SHADDA 0x0652: 0xF2, # ARABIC SUKUN } - diff --git a/Lib/encodings/iso8859_7.py b/Lib/encodings/iso8859_7.py index d1adb489bf7..4cce6e23472 100644 --- a/Lib/encodings/iso8859_7.py +++ b/Lib/encodings/iso8859_7.py @@ -560,4 +560,3 @@ encoding_map = { 0x20AC: 0xA4, # EURO SIGN 0x20AF: 0xA5, # DRACHMA SIGN } - diff --git a/Lib/encodings/iso8859_8.py b/Lib/encodings/iso8859_8.py index d935092413b..8c29a87b662 100644 --- a/Lib/encodings/iso8859_8.py +++ b/Lib/encodings/iso8859_8.py @@ -527,4 +527,3 @@ encoding_map = { 0x200F: 0xFE, # RIGHT-TO-LEFT MARK 0x2017: 0xDF, # DOUBLE LOW LINE } - diff --git a/Lib/encodings/iso8859_9.py b/Lib/encodings/iso8859_9.py index d2bb92cd4a8..9648e9f8c38 100644 --- a/Lib/encodings/iso8859_9.py +++ b/Lib/encodings/iso8859_9.py @@ -563,4 +563,3 @@ encoding_map = { 0x015E: 0xDE, # LATIN CAPITAL LETTER S WITH CEDILLA 0x015F: 0xFE, # LATIN SMALL LETTER S WITH CEDILLA } - diff --git a/Lib/encodings/koi8_r.py b/Lib/encodings/koi8_r.py index fa0fcdb3b52..3efeb56edd2 100644 --- a/Lib/encodings/koi8_r.py +++ b/Lib/encodings/koi8_r.py @@ -563,4 +563,3 @@ encoding_map = { 0x2593: 0x92, # DARK SHADE 0x25A0: 0x94, # BLACK SQUARE } - diff --git a/Lib/encodings/koi8_u.py b/Lib/encodings/koi8_u.py index 4709d9cd1ca..5f46db1700c 100644 --- a/Lib/encodings/koi8_u.py +++ b/Lib/encodings/koi8_u.py @@ -563,4 +563,3 @@ encoding_map = { 0x2593: 0x92, # DARK SHADE 0x25A0: 0x94, # BLACK SQUARE } - diff --git a/Lib/encodings/latin_1.py b/Lib/encodings/latin_1.py index b2a08395b6b..370160c0cb5 100644 --- a/Lib/encodings/latin_1.py +++ b/Lib/encodings/latin_1.py @@ -48,4 +48,3 @@ def getregentry(): streamreader=StreamReader, streamwriter=StreamWriter, ) - diff --git a/Lib/encodings/mac_centeuro.py b/Lib/encodings/mac_centeuro.py index 241712ec822..54a1510333a 100644 --- a/Lib/encodings/mac_centeuro.py +++ b/Lib/encodings/mac_centeuro.py @@ -563,4 +563,3 @@ encoding_map = { 0x2265: 0xB3, # GREATER-THAN OR EQUAL TO 0x25CA: 0xD7, # LOZENGE } - diff --git a/Lib/encodings/mac_croatian.py b/Lib/encodings/mac_croatian.py index 6ef72aeb175..9e93cddf3ce 100644 --- a/Lib/encodings/mac_croatian.py +++ b/Lib/encodings/mac_croatian.py @@ -563,4 +563,3 @@ encoding_map = { 0x25CA: 0xD7, # LOZENGE 0xF8FF: 0xD8, # Apple logo } - diff --git a/Lib/encodings/mac_cyrillic.py b/Lib/encodings/mac_cyrillic.py index ada395c64e0..8ffd715138a 100644 --- a/Lib/encodings/mac_cyrillic.py +++ b/Lib/encodings/mac_cyrillic.py @@ -563,4 +563,3 @@ encoding_map = { 0x2264: 0xB2, # LESS-THAN OR EQUAL TO 0x2265: 0xB3, # GREATER-THAN OR EQUAL TO } - diff --git a/Lib/encodings/mac_farsi.py b/Lib/encodings/mac_farsi.py index c83b6ad6446..6d26a429604 100644 --- a/Lib/encodings/mac_farsi.py +++ b/Lib/encodings/mac_farsi.py @@ -563,4 +563,3 @@ encoding_map = { 0x2026: 0x93, # HORIZONTAL ELLIPSIS, right-left 0x274A: 0xC0, # EIGHT TEARDROP-SPOKED PROPELLER ASTERISK, right-left } - diff --git a/Lib/encodings/mac_greek.py b/Lib/encodings/mac_greek.py index aa1894b550b..7264f9ae9d5 100644 --- a/Lib/encodings/mac_greek.py +++ b/Lib/encodings/mac_greek.py @@ -563,4 +563,3 @@ encoding_map = { 0x2264: 0xB2, # LESS-THAN OR EQUAL TO 0x2265: 0xB3, # GREATER-THAN OR EQUAL TO } - diff --git a/Lib/encodings/mac_iceland.py b/Lib/encodings/mac_iceland.py index 0c3f0544456..5d8d9ad93f5 100644 --- a/Lib/encodings/mac_iceland.py +++ b/Lib/encodings/mac_iceland.py @@ -563,4 +563,3 @@ encoding_map = { 0x25CA: 0xD7, # LOZENGE 0xF8FF: 0xF0, # Apple logo } - diff --git a/Lib/encodings/mac_roman.py b/Lib/encodings/mac_roman.py index 2de8ab586a3..9552e531aae 100644 --- a/Lib/encodings/mac_roman.py +++ b/Lib/encodings/mac_roman.py @@ -563,4 +563,3 @@ encoding_map = { 0xFB01: 0xDE, # LATIN SMALL LIGATURE FI 0xFB02: 0xDF, # LATIN SMALL LIGATURE FL } - diff --git a/Lib/encodings/mac_romanian.py b/Lib/encodings/mac_romanian.py index f8826de8356..51282c3c097 100644 --- a/Lib/encodings/mac_romanian.py +++ b/Lib/encodings/mac_romanian.py @@ -563,4 +563,3 @@ encoding_map = { 0x25CA: 0xD7, # LOZENGE 0xF8FF: 0xF0, # Apple logo } - diff --git a/Lib/encodings/mac_turkish.py b/Lib/encodings/mac_turkish.py index aee3f7e1ffc..4e5641f1812 100644 --- a/Lib/encodings/mac_turkish.py +++ b/Lib/encodings/mac_turkish.py @@ -563,4 +563,3 @@ encoding_map = { 0xF8A0: 0xF5, # undefined1 0xF8FF: 0xF0, # Apple logo } - diff --git a/Lib/encodings/tis_620.py b/Lib/encodings/tis_620.py index b0a8e4c2c9d..166d93268bf 100644 --- a/Lib/encodings/tis_620.py +++ b/Lib/encodings/tis_620.py @@ -554,4 +554,3 @@ encoding_map = { 0x0E5A: 0xFA, # THAI CHARACTER ANGKHANKHU 0x0E5B: 0xFB, # THAI CHARACTER KHOMUT } - diff --git a/Lib/encodings/utf_7.py b/Lib/encodings/utf_7.py index 7b11d59389d..d78d1926b30 100644 --- a/Lib/encodings/utf_7.py +++ b/Lib/encodings/utf_7.py @@ -38,4 +38,4 @@ def getregentry(): incrementaldecoder=IncrementalDecoder, streamreader=StreamReader, streamwriter=StreamWriter, - ) \ No newline at end of file + ) diff --git a/Lib/runpy.py b/Lib/runpy.py index c540aad6ba9..afb00982923 100755 --- a/Lib/runpy.py +++ b/Lib/runpy.py @@ -239,7 +239,7 @@ except AttributeError: importer = _FileSystemImporter(path_item) except ImportError: pass - return importer + return importer def _get_path_loader(mod_name, path=None): @@ -283,7 +283,7 @@ except AttributeError: If the module or package is accessible via the normal import mechanism, a wrapper around the relevant part of that machinery is returned. - + Non PEP 302 mechanisms (e.g. the Windows registry) used by the standard import machinery to find files in alternative locations are partially supported, but are searched AFTER sys.path. Normally, @@ -328,7 +328,7 @@ except AttributeError: else: # Top level module, so stick with default path sub_name = mod_name - + for importer in sys.meta_path: loader = importer.find_module(mod_name, path) if loader is not None: @@ -406,7 +406,7 @@ def _run_module_code(code, init_globals=None, def run_module(mod_name, init_globals=None, run_name=None, alter_sys=False): """Execute a module's code without importing it - + Returns the resulting top level namespace dictionary """ loader = _get_loader(mod_name) @@ -418,7 +418,7 @@ def run_module(mod_name, init_globals=None, filename = _get_filename(loader, mod_name) if run_name is None: run_name = mod_name - return _run_module_code(code, init_globals, run_name, + return _run_module_code(code, init_globals, run_name, filename, loader, alter_sys) diff --git a/Lib/test/test_runpy.py b/Lib/test/test_runpy.py index ffd886af1a6..88e990098a3 100644 --- a/Lib/test/test_runpy.py +++ b/Lib/test/test_runpy.py @@ -165,8 +165,8 @@ class RunModuleTest(unittest.TestCase): def test_main(): - run_unittest(RunModuleCodeTest) - run_unittest(RunModuleTest) + run_unittest(RunModuleCodeTest) + run_unittest(RunModuleTest) if __name__ == "__main__": - test_main() \ No newline at end of file + test_main()