# HG changeset patch # Parent 95df96aa2f5a03eab9d98324c4c4e2993b1ebb0f Issue #27626: Spelling fixes in docs, comments and internal names Based on patch by Ville Skyttä. diff -r 95df96aa2f5a Doc/howto/clinic.rst --- a/Doc/howto/clinic.rst Tue Jul 26 12:23:16 2016 -0400 +++ b/Doc/howto/clinic.rst Wed Jul 27 03:36:41 2016 +0000 @@ -1583,7 +1583,7 @@ preserve -This tells Clinic that the current contents of the output should be kept, unmodifed. +This tells Clinic that the current contents of the output should be kept, unmodified. This is used internally by Clinic when dumping output into ``file`` files; wrapping it in a Clinic block lets Clinic use its existing checksum functionality to ensure the file was not modified by hand before it gets overwritten. diff -r 95df96aa2f5a Doc/howto/sockets.rst --- a/Doc/howto/sockets.rst Tue Jul 26 12:23:16 2016 -0400 +++ b/Doc/howto/sockets.rst Wed Jul 27 03:36:41 2016 +0000 @@ -106,7 +106,7 @@ There's actually 3 general ways in which this loop could work - dispatching a thread to handle ``clientsocket``, create a new process to handle ``clientsocket``, or restructure this app to use non-blocking sockets, and -mulitplex between our "server" socket and any active ``clientsocket``\ s using +multiplex between our "server" socket and any active ``clientsocket``\ s using ``select``. More about that later. The important thing to understand now is this: this is *all* a "server" socket does. It doesn't send any data. It doesn't receive any data. It just produces "client" sockets. Each ``clientsocket`` is diff -r 95df96aa2f5a Doc/library/configparser.rst --- a/Doc/library/configparser.rst Tue Jul 26 12:23:16 2016 -0400 +++ b/Doc/library/configparser.rst Wed Jul 27 03:36:41 2016 +0000 @@ -66,7 +66,7 @@ <#supported-ini-file-structure>`_. Essentially, the file consists of sections, each of which contains keys with values. :mod:`configparser` classes can read and write such files. Let's start by -creating the above configuration file programatically. +creating the above configuration file programmatically. .. doctest:: diff -r 95df96aa2f5a Doc/library/importlib.rst --- a/Doc/library/importlib.rst Tue Jul 26 12:23:16 2016 -0400 +++ b/Doc/library/importlib.rst Wed Jul 27 03:36:41 2016 +0000 @@ -633,7 +633,7 @@ .. method:: path_stats(path) Optional abstract method which returns a :class:`dict` containing - metadata about the specifed path. Supported dictionary keys are: + metadata about the specified path. Supported dictionary keys are: - ``'mtime'`` (mandatory): an integer or floating-point number representing the modification time of the source code; diff -r 95df96aa2f5a Doc/library/os.rst --- a/Doc/library/os.rst Tue Jul 26 12:23:16 2016 -0400 +++ b/Doc/library/os.rst Wed Jul 27 03:36:41 2016 +0000 @@ -1938,7 +1938,7 @@ On Unix, *path* can be of type :class:`str` or :class:`bytes` (use :func:`~os.fsencode` and :func:`~os.fsdecode` to encode and decode :class:`bytes` paths). On Windows, *path* must be of type :class:`str`. - On both sytems, the type of the :attr:`~os.DirEntry.name` and + On both systems, the type of the :attr:`~os.DirEntry.name` and :attr:`~os.DirEntry.path` attributes of each :class:`os.DirEntry` will be of the same type as *path*. diff -r 95df96aa2f5a Doc/library/socket.rst --- a/Doc/library/socket.rst Tue Jul 26 12:23:16 2016 -0400 +++ b/Doc/library/socket.rst Wed Jul 27 03:36:41 2016 +0000 @@ -1226,7 +1226,7 @@ much data, if any, was successfully sent. .. versionchanged:: 3.5 - The socket timeout is no more reset each time data is sent successfuly. + The socket timeout is no more reset each time data is sent successfully. The socket timeout is now the maximum total duration to send all data. .. versionchanged:: 3.5 diff -r 95df96aa2f5a Include/longobject.h --- a/Include/longobject.h Tue Jul 26 12:23:16 2016 -0400 +++ b/Include/longobject.h Wed Jul 27 03:36:41 2016 +0000 @@ -160,7 +160,7 @@ example, if is_signed is 0 and there are more digits in the v than fit in n; or if is_signed is 1, v < 0, and n is just 1 bit shy of being large enough to hold a sign bit. OverflowError is set in this - case, but bytes holds the least-signficant n bytes of the true value. + case, but bytes holds the least-significant n bytes of the true value. */ PyAPI_FUNC(int) _PyLong_AsByteArray(PyLongObject* v, unsigned char* bytes, size_t n, diff -r 95df96aa2f5a Lib/ctypes/test/test_numbers.py --- a/Lib/ctypes/test/test_numbers.py Tue Jul 26 12:23:16 2016 -0400 +++ b/Lib/ctypes/test/test_numbers.py Wed Jul 27 03:36:41 2016 +0000 @@ -76,7 +76,7 @@ self.assertEqual(t(v).value, truth(v)) def test_typeerror(self): - # Only numbers are allowed in the contructor, + # Only numbers are allowed in the constructor, # otherwise TypeError is raised for t in signed_types + unsigned_types + float_types: self.assertRaises(TypeError, t, "") diff -r 95df96aa2f5a Lib/ctypes/test/test_structures.py --- a/Lib/ctypes/test/test_structures.py Tue Jul 26 12:23:16 2016 -0400 +++ b/Lib/ctypes/test/test_structures.py Wed Jul 27 03:36:41 2016 +0000 @@ -106,7 +106,7 @@ self.assertEqual(alignment(XX), alignment(X)) self.assertEqual(sizeof(XX), calcsize("3s 3s 0s")) - def test_emtpy(self): + def test_empty(self): # I had problems with these # # Although these are pathological cases: Empty Structures! diff -r 95df96aa2f5a Lib/datetime.py --- a/Lib/datetime.py Tue Jul 26 12:23:16 2016 -0400 +++ b/Lib/datetime.py Wed Jul 27 03:36:41 2016 +0000 @@ -721,7 +721,7 @@ @classmethod def fromordinal(cls, n): - """Contruct a date from a proleptic Gregorian ordinal. + """Construct a date from a proleptic Gregorian ordinal. January 1 of year 1 is day 1. Only the year, month and day are non-zero in the result. diff -r 95df96aa2f5a Lib/idlelib/calltip_w.py --- a/Lib/idlelib/calltip_w.py Tue Jul 26 12:23:16 2016 -0400 +++ b/Lib/idlelib/calltip_w.py Wed Jul 27 03:36:41 2016 +0000 @@ -9,7 +9,7 @@ HIDE_SEQUENCES = ("", "") CHECKHIDE_VIRTUAL_EVENT_NAME = "<>" CHECKHIDE_SEQUENCES = ("", "") -CHECKHIDE_TIME = 100 # miliseconds +CHECKHIDE_TIME = 100 # milliseconds MARK_RIGHT = "calltipwindowregion_right" diff -r 95df96aa2f5a Lib/idlelib/idle_test/test_query.py --- a/Lib/idlelib/idle_test/test_query.py Tue Jul 26 12:23:16 2016 -0400 +++ b/Lib/idlelib/idle_test/test_query.py Wed Jul 27 03:36:41 2016 +0000 @@ -146,7 +146,7 @@ "Test ModuleName subclass of Query." class Dummy_ModuleName: - entry_ok = query.ModuleName.entry_ok # Funtion being tested. + entry_ok = query.ModuleName.entry_ok # Function being tested. text0 = '' entry = Var() diff -r 95df96aa2f5a Lib/idlelib/parenmatch.py --- a/Lib/idlelib/parenmatch.py Tue Jul 26 12:23:16 2016 -0400 +++ b/Lib/idlelib/parenmatch.py Wed Jul 27 03:36:41 2016 +0000 @@ -9,7 +9,7 @@ from idlelib.config import idleConf _openers = {')':'(',']':'[','}':'{'} -CHECK_DELAY = 100 # miliseconds +CHECK_DELAY = 100 # milliseconds class ParenMatch: """Highlight matching parentheses diff -r 95df96aa2f5a Lib/platform.py --- a/Lib/platform.py Tue Jul 26 12:23:16 2016 -0400 +++ b/Lib/platform.py Wed Jul 27 03:36:41 2016 +0000 @@ -61,7 +61,7 @@ # though # 0.5.2 - fixed uname() to return '' instead of 'unknown' in all # return values (the system uname command tends to return -# 'unknown' instead of just leaving the field emtpy) +# 'unknown' instead of just leaving the field empty) # 0.5.1 - included code for slackware dist; added exception handlers # to cover up situations where platforms don't have os.popen # (e.g. Mac) or fail on socket.gethostname(); fixed libc diff -r 95df96aa2f5a Lib/shutil.py --- a/Lib/shutil.py Tue Jul 26 12:23:16 2016 -0400 +++ b/Lib/shutil.py Wed Jul 27 03:36:41 2016 +0000 @@ -853,7 +853,7 @@ _UNPACK_FORMATS[name] = extensions, function, extra_args, description def unregister_unpack_format(name): - """Removes the pack format from the registery.""" + """Removes the pack format from the registry.""" del _UNPACK_FORMATS[name] def _ensure_directory(path): diff -r 95df96aa2f5a Lib/test/eintrdata/eintr_tester.py --- a/Lib/test/eintrdata/eintr_tester.py Tue Jul 26 12:23:16 2016 -0400 +++ b/Lib/test/eintrdata/eintr_tester.py Wed Jul 27 03:36:41 2016 +0000 @@ -378,7 +378,7 @@ @unittest.skipUnless(hasattr(signal, 'sigwaitinfo'), 'need signal.sigwaitinfo()') def test_sigwaitinfo(self): - # Issue #25277, #25868: give a few miliseconds to the parent process + # Issue #25277, #25868: give a few milliseconds to the parent process # between os.write() and signal.sigwaitinfo() to works around a race # condition self.sleep_time = 0.100 diff -r 95df96aa2f5a Lib/test/test_collections.py --- a/Lib/test/test_collections.py Tue Jul 26 12:23:16 2016 -0400 +++ b/Lib/test/test_collections.py Wed Jul 27 03:36:41 2016 +0000 @@ -114,7 +114,7 @@ self.assertEqual(f['b'], 5) # find first in chain self.assertEqual(f.parents['b'], 2) # look beyond maps[0] - def test_contructor(self): + def test_constructor(self): self.assertEqual(ChainMap().maps, [{}]) # no-args --> one new dict self.assertEqual(ChainMap({1:2}).maps, [{1:2}]) # 1 arg --> list diff -r 95df96aa2f5a Lib/test/test_deque.py --- a/Lib/test/test_deque.py Tue Jul 26 12:23:16 2016 -0400 +++ b/Lib/test/test_deque.py Wed Jul 27 03:36:41 2016 +0000 @@ -494,7 +494,7 @@ d.clear() self.assertEqual(len(d), 0) self.assertEqual(list(d), []) - d.clear() # clear an emtpy deque + d.clear() # clear an empty deque self.assertEqual(list(d), []) def test_remove(self): diff -r 95df96aa2f5a Lib/test/test_enum.py --- a/Lib/test/test_enum.py Tue Jul 26 12:23:16 2016 -0400 +++ b/Lib/test/test_enum.py Wed Jul 27 03:36:41 2016 +0000 @@ -677,7 +677,7 @@ self.Season.SPRING] ) - def test_programatic_function_string(self): + def test_programmatic_function_string(self): SummerMonth = Enum('SummerMonth', 'june july august') lst = list(SummerMonth) self.assertEqual(len(lst), len(SummerMonth)) @@ -694,7 +694,7 @@ self.assertIn(e, SummerMonth) self.assertIs(type(e), SummerMonth) - def test_programatic_function_string_with_start(self): + def test_programmatic_function_string_with_start(self): SummerMonth = Enum('SummerMonth', 'june july august', start=10) lst = list(SummerMonth) self.assertEqual(len(lst), len(SummerMonth)) @@ -711,7 +711,7 @@ self.assertIn(e, SummerMonth) self.assertIs(type(e), SummerMonth) - def test_programatic_function_string_list(self): + def test_programmatic_function_string_list(self): SummerMonth = Enum('SummerMonth', ['june', 'july', 'august']) lst = list(SummerMonth) self.assertEqual(len(lst), len(SummerMonth)) @@ -728,7 +728,7 @@ self.assertIn(e, SummerMonth) self.assertIs(type(e), SummerMonth) - def test_programatic_function_string_list_with_start(self): + def test_programmatic_function_string_list_with_start(self): SummerMonth = Enum('SummerMonth', ['june', 'july', 'august'], start=20) lst = list(SummerMonth) self.assertEqual(len(lst), len(SummerMonth)) @@ -745,7 +745,7 @@ self.assertIn(e, SummerMonth) self.assertIs(type(e), SummerMonth) - def test_programatic_function_iterable(self): + def test_programmatic_function_iterable(self): SummerMonth = Enum( 'SummerMonth', (('june', 1), ('july', 2), ('august', 3)) @@ -765,7 +765,7 @@ self.assertIn(e, SummerMonth) self.assertIs(type(e), SummerMonth) - def test_programatic_function_from_dict(self): + def test_programmatic_function_from_dict(self): SummerMonth = Enum( 'SummerMonth', OrderedDict((('june', 1), ('july', 2), ('august', 3))) @@ -785,7 +785,7 @@ self.assertIn(e, SummerMonth) self.assertIs(type(e), SummerMonth) - def test_programatic_function_type(self): + def test_programmatic_function_type(self): SummerMonth = Enum('SummerMonth', 'june july august', type=int) lst = list(SummerMonth) self.assertEqual(len(lst), len(SummerMonth)) @@ -801,7 +801,7 @@ self.assertIn(e, SummerMonth) self.assertIs(type(e), SummerMonth) - def test_programatic_function_type_with_start(self): + def test_programmatic_function_type_with_start(self): SummerMonth = Enum('SummerMonth', 'june july august', type=int, start=30) lst = list(SummerMonth) self.assertEqual(len(lst), len(SummerMonth)) @@ -817,7 +817,7 @@ self.assertIn(e, SummerMonth) self.assertIs(type(e), SummerMonth) - def test_programatic_function_type_from_subclass(self): + def test_programmatic_function_type_from_subclass(self): SummerMonth = IntEnum('SummerMonth', 'june july august') lst = list(SummerMonth) self.assertEqual(len(lst), len(SummerMonth)) @@ -833,7 +833,7 @@ self.assertIn(e, SummerMonth) self.assertIs(type(e), SummerMonth) - def test_programatic_function_type_from_subclass_with_start(self): + def test_programmatic_function_type_from_subclass_with_start(self): SummerMonth = IntEnum('SummerMonth', 'june july august', start=40) lst = list(SummerMonth) self.assertEqual(len(lst), len(SummerMonth)) diff -r 95df96aa2f5a Lib/test/test_fstring.py --- a/Lib/test/test_fstring.py Tue Jul 26 12:23:16 2016 -0400 +++ b/Lib/test/test_fstring.py Wed Jul 27 03:36:41 2016 +0000 @@ -250,7 +250,7 @@ ]) self.assertAllRaise(SyntaxError, "invalid syntax", - [# Invalid sytax inside a nested spec. + [# Invalid syntax inside a nested spec. "f'{4:{/5}}'", ]) diff -r 95df96aa2f5a Lib/test/test_http_cookiejar.py --- a/Lib/test/test_http_cookiejar.py Tue Jul 26 12:23:16 2016 -0400 +++ b/Lib/test/test_http_cookiejar.py Wed Jul 27 03:36:41 2016 +0000 @@ -396,7 +396,7 @@ ## comma-separated list, it'll be a headache to parse (at least my head ## starts hurting every time I think of that code). ## - Expires: You'll get all sorts of date formats in the expires, -## including emtpy expires attributes ("expires="). Be as flexible as you +## including empty expires attributes ("expires="). Be as flexible as you ## can, and certainly don't expect the weekday to be there; if you can't ## parse it, just ignore it and pretend it's a session cookie. ## - Domain-matching: Netscape uses the 2-dot rule for _all_ domains, not diff -r 95df96aa2f5a Lib/test/test_math.py --- a/Lib/test/test_math.py Tue Jul 26 12:23:16 2016 -0400 +++ b/Lib/test/test_math.py Wed Jul 27 03:36:41 2016 +0000 @@ -1253,8 +1253,8 @@ (1.0e200, .999999999999999e200)] self.assertAllNotClose(zero_tolerance_not_close_examples, rel_tol=0.0) - def test_assymetry(self): - # test the assymetry example from PEP 485 + def test_asymmetry(self): + # test the asymmetry example from PEP 485 self.assertAllClose([(9, 10), (10, 9)], rel_tol=0.1) def test_integers(self): diff -r 95df96aa2f5a Lib/test/test_nntplib.py --- a/Lib/test/test_nntplib.py Tue Jul 26 12:23:16 2016 -0400 +++ b/Lib/test/test_nntplib.py Wed Jul 27 03:36:41 2016 +0000 @@ -1465,14 +1465,14 @@ def test_service_temporarily_unavailable(self): #Test service temporarily unavailable class Handler(NNTPv1Handler): - welcome = '400 Service temporarily unavilable' + welcome = '400 Service temporarily unavailable' self.check_constructor_error_conditions( Handler, nntplib.NNTPTemporaryError, Handler.welcome) def test_service_permanently_unavailable(self): #Test service permanently unavailable class Handler(NNTPv1Handler): - welcome = '502 Service permanently unavilable' + welcome = '502 Service permanently unavailable' self.check_constructor_error_conditions( Handler, nntplib.NNTPPermanentError, Handler.welcome) diff -r 95df96aa2f5a Lib/test/test_shutil.py --- a/Lib/test/test_shutil.py Tue Jul 26 12:23:16 2016 -0400 +++ b/Lib/test/test_shutil.py Wed Jul 27 03:36:41 2016 +0000 @@ -1257,7 +1257,7 @@ self.assertRaises(shutil.ReadError, unpack_archive, TESTFN) self.assertRaises(ValueError, unpack_archive, TESTFN, format='xxx') - def test_unpack_registery(self): + def test_unpack_registry(self): formats = get_unpack_formats() diff -r 95df96aa2f5a Lib/test/test_structseq.py --- a/Lib/test/test_structseq.py Tue Jul 26 12:23:16 2016 -0400 +++ b/Lib/test/test_structseq.py Wed Jul 27 03:36:41 2016 +0000 @@ -97,7 +97,7 @@ class Exc(Exception): pass - # Devious code could crash structseqs' contructors + # Devious code could crash structseqs' constructors class C: def __getitem__(self, i): raise Exc diff -r 95df96aa2f5a Lib/test/test_subprocess.py --- a/Lib/test/test_subprocess.py Tue Jul 26 12:23:16 2016 -0400 +++ b/Lib/test/test_subprocess.py Wed Jul 27 03:36:41 2016 +0000 @@ -1351,7 +1351,7 @@ desired_exception = e desired_exception.strerror += ': ' + repr(self._nonexistent_dir) else: - self.fail("chdir to nonexistant directory %s succeeded." % + self.fail("chdir to nonexistent directory %s succeeded." % self._nonexistent_dir) return desired_exception diff -r 95df96aa2f5a Lib/unittest/case.py --- a/Lib/unittest/case.py Tue Jul 26 12:23:16 2016 -0400 +++ b/Lib/unittest/case.py Wed Jul 27 03:36:41 2016 +0000 @@ -836,7 +836,7 @@ between the two objects is more than the given delta. Note that decimal places (from zero) are usually not the same - as significant digits (measured from the most signficant digit). + as significant digits (measured from the most significant digit). If the two objects compare equal then they will automatically compare almost equal. @@ -875,7 +875,7 @@ between the two objects is less than the given delta. Note that decimal places (from zero) are usually not the same - as significant digits (measured from the most signficant digit). + as significant digits (measured from the most significant digit). Objects that are equal automatically fail. """ diff -r 95df96aa2f5a Misc/NEWS --- a/Misc/NEWS Tue Jul 26 12:23:16 2016 -0400 +++ b/Misc/NEWS Wed Jul 27 03:36:41 2016 +0000 @@ -3166,7 +3166,7 @@ the FTP connection failed to fix a ResourceWarning. - Issue #23853: :meth:`socket.socket.sendall` does no more reset the socket - timeout each time data is sent successfuly. The socket timeout is now the + timeout each time data is sent successfully. The socket timeout is now the maximum total duration to send all data. - Issue #22721: An order of multiline pprint output of set or dict containing diff -r 95df96aa2f5a Modules/_ctypes/_ctypes.c --- a/Modules/_ctypes/_ctypes.c Tue Jul 26 12:23:16 2016 -0400 +++ b/Modules/_ctypes/_ctypes.c Wed Jul 27 03:36:41 2016 +0000 @@ -332,7 +332,7 @@ /* PyCStructType_Type - a meta type/class. Creating a new class using this one as - __metaclass__ will call the contructor StructUnionType_new. It replaces the + __metaclass__ will call the constructor StructUnionType_new. It replaces the tp_dict member with a new instance of StgDict, and initializes the C accessible fields somehow. */ diff -r 95df96aa2f5a Modules/itertoolsmodule.c --- a/Modules/itertoolsmodule.c Tue Jul 26 12:23:16 2016 -0400 +++ b/Modules/itertoolsmodule.c Wed Jul 27 03:36:41 2016 +0000 @@ -1923,7 +1923,7 @@ PyDoc_STRVAR(chain_from_iterable_doc, "chain.from_iterable(iterable) --> chain object\n\ \n\ -Alternate chain() contructor taking a single iterable argument\n\ +Alternate chain() constructor taking a single iterable argument\n\ that evaluates lazily."); static PyMethodDef chain_methods[] = { diff -r 95df96aa2f5a Objects/exceptions.c --- a/Objects/exceptions.c Tue Jul 26 12:23:16 2016 -0400 +++ b/Objects/exceptions.c Wed Jul 27 03:36:41 2016 +0000 @@ -1849,7 +1849,7 @@ return PyUnicode_FromString(""); /* Get reason and encoding as strings, which they might not be if - they've been modified after we were contructed. */ + they've been modified after we were constructed. */ reason_str = PyObject_Str(uself->reason); if (reason_str == NULL) goto done; @@ -1974,7 +1974,7 @@ return PyUnicode_FromString(""); /* Get reason and encoding as strings, which they might not be if - they've been modified after we were contructed. */ + they've been modified after we were constructed. */ reason_str = PyObject_Str(uself->reason); if (reason_str == NULL) goto done; @@ -2072,7 +2072,7 @@ return PyUnicode_FromString(""); /* Get reason as a string, which it might not be if it's been - modified after we were contructed. */ + modified after we were constructed. */ reason_str = PyObject_Str(uself->reason); if (reason_str == NULL) goto done; diff -r 95df96aa2f5a Objects/longobject.c --- a/Objects/longobject.c Tue Jul 26 12:23:16 2016 -0400 +++ b/Objects/longobject.c Wed Jul 27 03:36:41 2016 +0000 @@ -775,10 +775,10 @@ size_t i; const unsigned char* p = pendbyte; const int pincr = -incr; /* search MSB to LSB */ - const unsigned char insignficant = is_signed ? 0xff : 0x00; + const unsigned char insignificant = is_signed ? 0xff : 0x00; for (i = 0; i < n; ++i, p += pincr) { - if (*p != insignficant) + if (*p != insignificant) break; } numsignificantbytes = n - i; diff -r 95df96aa2f5a Tools/clinic/clinic_test.py --- a/Tools/clinic/clinic_test.py Tue Jul 26 12:23:16 2016 -0400 +++ b/Tools/clinic/clinic_test.py Wed Jul 27 03:36:41 2016 +0000 @@ -90,7 +90,7 @@ # the "end line" for the block if it # didn't end in "\n" (as in, the last) # byte of the file was '/'. - # so it woudl spit out an end line for you. + # so it would spit out an end line for you. # and since you really already had one, # the last line of the block got corrupted. c = clinic.Clinic(clinic.CLanguage(None)) diff -r 95df96aa2f5a Tools/demo/redemo.py --- a/Tools/demo/redemo.py Tue Jul 26 12:23:16 2016 -0400 +++ b/Tools/demo/redemo.py Wed Jul 27 03:36:41 2016 +0000 @@ -1,6 +1,6 @@ #!/usr/bin/env python3 -"""Basic regular expression demostration facility (Perl style syntax).""" +"""Basic regular expression demonstration facility (Perl style syntax).""" from tkinter import * import re diff -r 95df96aa2f5a Tools/freeze/freeze.py --- a/Tools/freeze/freeze.py Tue Jul 26 12:23:16 2016 -0400 +++ b/Tools/freeze/freeze.py Wed Jul 27 03:36:41 2016 +0000 @@ -159,7 +159,7 @@ except getopt.error as msg: usage('getopt error: ' + str(msg)) - # proces option arguments + # process option arguments for o, a in opts: if o == '-h': print(__doc__)