Support Windows 7 with Python 3.8
This commit is contained in:
+6
-2
@@ -1,4 +1,4 @@
|
||||
"""Windows ping spike monitor. Python 3.10+, standard library only."""
|
||||
"""Windows ping spike monitor. Python 3.8+, standard library only."""
|
||||
from __future__ import annotations
|
||||
|
||||
import argparse
|
||||
@@ -376,7 +376,11 @@ def main():
|
||||
log.write("error", f"Error: {error}", error=str(error))
|
||||
finally:
|
||||
stop.set()
|
||||
executor.shutdown(wait=True, cancel_futures=True)
|
||||
# Python 3.8 has no shutdown(cancel_futures=...). There is at most
|
||||
# one submitted trace; cancel it if queued, or let stop end it if running.
|
||||
if pending is not None:
|
||||
pending.cancel()
|
||||
executor.shutdown(wait=True)
|
||||
log.write("stop", "Monitor stopped.", samples=samples)
|
||||
log.file.close()
|
||||
return 1 if failed else 0
|
||||
|
||||
Reference in New Issue
Block a user