Commit 82d8ca0f authored by Guilhem Saurel's avatar Guilhem Saurel
Browse files

[Python] ServerManager is now available in hpp-corbaserver

parent 3431a1e1
......@@ -4,17 +4,23 @@
import os
import subprocess
import time
import warnings
try:
from hpp.utils import ServerManager
warnings.warn('Please import ServerManager directly from hpp.utils', DeprecationWarning)
except ImportError: # hpp-corbaserver < 4.9.1 fallback
try:
from subprocess import DEVNULL, run
except ImportError: # Python2 fallback
except ImportError: # Python2 fallback
DEVNULL = os.open(os.devnull, os.O_RDWR)
def run(*args):
subprocess.Popen(*args).wait()
class ServerManager:
class ServerManager:
"""A context to ensure a server is running."""
def __init__(self, server):
self.server = server
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment