diff options
author | Nicolargo <nicolas@nicolargo.com> | 2014-10-02 22:13:48 +0200 |
---|---|---|
committer | Nicolargo <nicolas@nicolargo.com> | 2014-10-02 22:13:48 +0200 |
commit | 736c8ec7ae7db2d5a973fd280a7271b631be8053 (patch) | |
tree | e85eca2ef6fd24980c67f24c3411a1a810a02a28 /unitest-xmlrpc.py | |
parent | 6915cf887d88fb2c41689d91fef23353edc56091 (diff) |
Add Tox file for testing
Diffstat (limited to 'unitest-xmlrpc.py')
-rwxr-xr-x | unitest-xmlrpc.py | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/unitest-xmlrpc.py b/unitest-xmlrpc.py index d1e56d4f..4d14ce13 100755 --- a/unitest-xmlrpc.py +++ b/unitest-xmlrpc.py @@ -27,9 +27,13 @@ import time import unittest import shlex import subprocess -import xmlrpclib import json import types +try: + from xmlrpc.client import ServerProxy +except ImportError: + # Python 2 + from xmlrpclib import ServerProxy from glances.core.glances_globals import ( appname, @@ -68,7 +72,7 @@ from glances.core.glances_stats import GlancesStats stats = GlancesStats() # Init the XML/RCP client -client = xmlrpclib.ServerProxy(URL) +client = ServerProxy(URL) # Unitest class # ============== |