diff options
Diffstat (limited to 'module/remote/thriftbackend/ThriftTest.py')
-rw-r--r-- | module/remote/thriftbackend/ThriftTest.py | 18 |
1 files changed, 10 insertions, 8 deletions
diff --git a/module/remote/thriftbackend/ThriftTest.py b/module/remote/thriftbackend/ThriftTest.py index 69ac6a745..c9c0d3cf3 100644 --- a/module/remote/thriftbackend/ThriftTest.py +++ b/module/remote/thriftbackend/ThriftTest.py @@ -1,14 +1,16 @@ -#!/usr/bin/env python # -*- coding: utf-8 -*- +import os +import platform import sys -from os.path import join,abspath,dirname -path = join((abspath(dirname(__file__))), "..","..", "lib") -sys.path.append(path) +if "64" in platform.machine(): + sys.path.append(os.path.join(pypath, "lib64")) +sys.path.append(os.path.join(pypath, "lib")) -from thriftgen.pyload import Pyload -from thriftgen.pyload.ttypes import * + +from pyload.remote.thriftbackend.thriftgen.pyload import Pyload +from pyload.remote.thriftbackend.thriftgen.pyload.ttypes import * from Socket import Socket from thrift import Thrift @@ -22,11 +24,11 @@ import xmlrpclib def bench(f, *args, **kwargs): s = time() - ret = [f(*args, **kwargs) for i in range(0,100)] + ret = [f(*args, **kwargs) for i in range(0, 100)] e = time() try: print "%s: %f s" % (f._Method__name, e-s) - except : + except Exception: print "%s: %f s" % (f.__name__, e-s) return ret |