summaryrefslogtreecommitdiff
path: root/yaksh/code_server.py
diff options
context:
space:
mode:
authorPrabhu Ramachandran2016-10-04 15:44:05 +0530
committerGitHub2016-10-04 15:44:05 +0530
commit91dd42214ba5ad88c5158b50a7746caa3841a883 (patch)
tree188f8aa284783e844eccffe350839d6a18f4da8b /yaksh/code_server.py
parent6b08e56fe3cf70ffbcbd1ed432dde25babe48148 (diff)
parent59fa975a9fd0f6728cf62b1069abecac95a77b68 (diff)
downloadonline_test-91dd42214ba5ad88c5158b50a7746caa3841a883.tar.gz
online_test-91dd42214ba5ad88c5158b50a7746caa3841a883.tar.bz2
online_test-91dd42214ba5ad88c5158b50a7746caa3841a883.zip
Merge pull request #143 from adityacp/python2to3-migrate
Migration Python 2 to 3
Diffstat (limited to 'yaksh/code_server.py')
-rwxr-xr-xyaksh/code_server.py14
1 files changed, 10 insertions, 4 deletions
diff --git a/yaksh/code_server.py b/yaksh/code_server.py
index e19e9c8..b3c9c30 100755
--- a/yaksh/code_server.py
+++ b/yaksh/code_server.py
@@ -23,7 +23,7 @@ that returns an available server.
"""
# Standard library imports
-from SimpleXMLRPCServer import SimpleXMLRPCServer
+from __future__ import unicode_literals
import json
from multiprocessing import Process, Queue
import os
@@ -36,6 +36,12 @@ import subprocess
import sys
try:
+ from SimpleXMLRPCServer import SimpleXMLRPCServer
+except ImportError:
+ # The above import will not work on Python-3.x.
+ from xmlrpc.server import SimpleXMLRPCServer
+
+try:
from urllib import unquote
except ImportError:
# The above import will not work on Python-3.x.
@@ -45,9 +51,9 @@ except ImportError:
from tornado.ioloop import IOLoop
from tornado.web import Application, RequestHandler
-# Local imports.
-from settings import SERVER_PORTS, SERVER_POOL_PORT
-from language_registry import create_evaluator_instance, unpack_json
+# Local imports
+from .settings import SERVER_PORTS, SERVER_POOL_PORT
+from .language_registry import create_evaluator_instance, unpack_json
MY_DIR = abspath(dirname(__file__))