summaryrefslogtreecommitdiff
path: root/server
diff options
context:
space:
mode:
authorAleksander Sadikov <sasha@fri.uni-lj.si>2015-08-30 18:47:04 +0200
committerAleksander Sadikov <sasha@fri.uni-lj.si>2015-08-30 18:47:04 +0200
commit501a4cc1aef38a1c08e42074b8f071372d9b7018 (patch)
treea9cf942a8062369410eac4aaa110d14b48977369 /server
parentce5bb5482f011398e894ad13c16ca7529fdce9b0 (diff)
Path (for loading modules) now usable also on Windows.
Diffstat (limited to 'server')
-rw-r--r--server/problems.py3
1 files changed, 2 insertions, 1 deletions
diff --git a/server/problems.py b/server/problems.py
index fed9e77..f6f4e45 100644
--- a/server/problems.py
+++ b/server/problems.py
@@ -3,6 +3,7 @@
import sys
import importlib.machinery
import threading
+import os.path
from db import get_connection, return_connection
#sys.path.append('/home/aless/job/codeq/source/codeq-problems/')
@@ -15,7 +16,7 @@ def load_module(fullname):
mod = sys.modules.get(fullname, None)
if mod is None:
parts = fullname.split('.')
- d = _path_prefix + '/'.join(parts[0:-1])
+ d = os.path.join(_path_prefix, *parts[:-1])
ff = importlib.machinery.FileFinder(d, (importlib.machinery.SourceFileLoader, ['.py']))
spec = ff.find_spec(fullname)
mod = type(sys)(fullname)