diff options
Diffstat (limited to 'yaksh/code_evaluator.py')
-rw-r--r-- | yaksh/code_evaluator.py | 14 |
1 files changed, 11 insertions, 3 deletions
diff --git a/yaksh/code_evaluator.py b/yaksh/code_evaluator.py index 8a9b7a6..a55aed3 100644 --- a/yaksh/code_evaluator.py +++ b/yaksh/code_evaluator.py @@ -1,5 +1,6 @@ +#!/usr/bin/env python +from __future__ import absolute_import import sys -from SimpleXMLRPCServer import SimpleXMLRPCServer import pwd import os import stat @@ -9,8 +10,15 @@ import traceback from multiprocessing import Process, Queue import subprocess import re -# Local imports. -from settings import SERVER_TIMEOUT + +try: + from SimpleXMLRPCServer import SimpleXMLRPCServer +except ImportError: + # The above import will not work on Python-3.x. + from xmlrpc.server import SimpleXMLRPCServer + +# Local imports +from .settings import SERVER_TIMEOUT MY_DIR = abspath(dirname(__file__)) |