Fix some issues and do some code cleanup

This commit is contained in:
Justine Tunney 2022-05-23 10:15:53 -07:00
parent 1f229e4efc
commit 312ed5c67c
72 changed files with 880 additions and 982 deletions

View file

@ -2921,7 +2921,7 @@ Invalid file name:
>>> print(normalize(err)) # doctest: +ELLIPSIS
Traceback (most recent call last):
...
FileNotFoundError: [Errno 2] ENOENT/2/No such file or directory: 'nosuchfile'
FileNotFoundError: [Errno 2] ENOENT...
Invalid doctest option:

View file

@ -29,7 +29,7 @@ class ModuleTests(unittest.TestCase):
self.fail("__name__ = %s" % repr(s))
except AttributeError:
pass
if cosmo.MODE != 'tiny':
if 'tiny' not in cosmo.MODE:
self.assertEqual(foo.__doc__, ModuleType.__doc__)
def test_uninitialized_missing_getattr(self):

View file

@ -12,6 +12,7 @@
#include "libc/dns/ent.h"
#include "libc/errno.h"
#include "libc/nt/enum/version.h"
#include "libc/nt/version.h"
#include "libc/runtime/runtime.h"
#include "libc/sock/sock.h"
#include "libc/sysv/consts/af.h"
@ -7146,9 +7147,9 @@ PyInit__socket(void)
if (TCP_USER_TIMEOUT) PyModule_AddIntMacro(m, TCP_USER_TIMEOUT);
if (TCP_SAVE_SYN) PyModule_AddIntMacro(m, TCP_SAVE_SYN);
if (TCP_SAVED_SYN) PyModule_AddIntMacro(m, TCP_SAVED_SYN);
if (TCP_KEEPCNT && (!IsWindows() || NtGetVersion() >= kNtVersionWindows10))
if (TCP_KEEPCNT && (!IsWindows() || IsAtLeastWindows10()))
PyModule_AddIntMacro(m, TCP_KEEPCNT);
if (TCP_FASTOPEN && (!IsWindows() || NtGetVersion() >= kNtVersionWindows10))
if (TCP_FASTOPEN && (!IsWindows() || IsAtLeastWindows10()))
PyModule_AddIntMacro(m, TCP_FASTOPEN);
if (TCP_FASTOPEN_CONNECT)
PyModule_AddIntMacro(m, TCP_FASTOPEN_CONNECT);