Changeset: 6e1797254328 for MonetDB URL: https://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=6e1797254328 Modified Files: testing/Mtest.py.in Branch: Oct2020 Log Message:
Use with so that we don't have to close explicitly. diffs (19 lines): diff --git a/testing/Mtest.py.in b/testing/Mtest.py.in --- a/testing/Mtest.py.in +++ b/testing/Mtest.py.in @@ -4075,13 +4075,12 @@ def main(argv) : if THISFILE == "Mtest.py": # env['MAPIPORT'] not available on Mapprove.py try: - s = socket.socket(socket.AF_INET6, socket.SOCK_STREAM) - s.bind(('::1', int(env['MAPIPORT']))) + with socket.socket(socket.AF_INET6, socket.SOCK_STREAM) as s: + s.bind(('::1', int(env['MAPIPORT']))) except socket.error as err: CONDITIONALS['HAVE_IPV6'] = '' # False else: CONDITIONALS['HAVE_IPV6'] = '#' # True - s.close() # read '.Mapprove.rc' if THISFILE == 'Mapprove.py': _______________________________________________ checkin-list mailing list checkin-list@monetdb.org https://www.monetdb.org/mailman/listinfo/checkin-list