From 501a4cc1aef38a1c08e42074b8f071372d9b7018 Mon Sep 17 00:00:00 2001 From: Aleksander Sadikov Date: Sun, 30 Aug 2015 18:47:04 +0200 Subject: Path (for loading modules) now usable also on Windows. --- server/problems.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'server') 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) -- cgit v1.2.1