Don't wait during selftest process cleanup
[mudpy.git] / mudpy / tests / selftest.py
index c14baff..bb6f28a 100644 (file)
@@ -1,4 +1,4 @@
-# Copyright (c) 2004-2020 mudpy authors. Permission to use, copy,
+# Copyright (c) 2004-2021 mudpy authors. Permission to use, copy,
 # modify, and distribute this software is granted under terms
 # provided in the LICENSE file distributed with this software.
 
@@ -461,7 +461,6 @@ def start_service(config):
         try:
             # Stop the running service
             os.kill(pid, 15)
-            time.sleep(1)
         except ProcessLookupError:
             # If there was no process, just remove the stale PID file
             os.remove(pidfile)
@@ -546,7 +545,8 @@ def option_callback(telnet_socket, command, option):
 
 def check_debug():
     if len(sys.argv) > 1:
-        config = yaml.safe_load(open(sys.argv[1]))
+        with open(sys.argv[1]) as config_fd:
+            config = yaml.safe_load(config_fd)
         return config.get(".mudpy.limit.debug", False)
     return False