Skip to content

Commit 7ba6e10

Browse files
committed
Minor cleanup
1 parent ba2d7bb commit 7ba6e10

File tree

1 file changed

+3
-8
lines changed

1 file changed

+3
-8
lines changed

src/robotremoteserver.py

Lines changed: 3 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -27,11 +27,11 @@
2727
if sys.version_info < (3,):
2828
from StringIO import StringIO
2929
from SimpleXMLRPCServer import SimpleXMLRPCServer
30-
from xmlrpclib import Binary
30+
from xmlrpclib import Binary, ServerProxy
3131
PY2, PY3 = True, False
3232
else:
3333
from io import StringIO
34-
from xmlrpc.client import Binary
34+
from xmlrpc.client import Binary, ServerProxy
3535
from xmlrpc.server import SimpleXMLRPCServer
3636
PY2, PY3 = False, True
3737
unicode = str
@@ -314,11 +314,6 @@ def _write_to_stream(self, msg, stream):
314314

315315

316316
if __name__ == '__main__':
317-
if PY2:
318-
from xmlrpclib import ServerProxy
319-
else:
320-
from xmlrpc.client import ServerProxy
321-
322317
def stop(uri):
323318
server = test(uri, log_success=False)
324319
if server is not None:
@@ -340,7 +335,7 @@ def parse_args(args):
340335
actions = {'stop': stop, 'test': test}
341336
if not args or len(args) > 2 or args[0] not in actions:
342337
sys.exit('Usage: python -m robotremoteserver test|stop [uri]')
343-
uri = len(args) == 2 and args[1] or 'http://127.0.0.1:8270'
338+
uri = args[1] if len(args) == 2 else 'http://127.0.0.1:8270'
344339
if '://' not in uri:
345340
uri = 'http://' + uri
346341
return actions[args[0]], uri

0 commit comments

Comments
 (0)