From 2e8c2fddfd649fb67e732e275b343fcb1c24b118 Mon Sep 17 00:00:00 2001 From: pjenvey Date: Tue, 14 Jul 2009 21:32:44 +0000 Subject: use abspath, fixes path handling on Jython on Windows thanks crankycoder --- paste/deploy/loadwsgi.py | 12 ++---------- 1 file changed, 2 insertions(+), 10 deletions(-) diff --git a/paste/deploy/loadwsgi.py b/paste/deploy/loadwsgi.py index bffa500..86aa604 100644 --- a/paste/deploy/loadwsgi.py +++ b/paste/deploy/loadwsgi.py @@ -2,7 +2,6 @@ # Licensed under the MIT license: http://www.opensource.org/licenses/mit-license.php import os import re -import sys import urllib from ConfigParser import ConfigParser import pkg_resources @@ -249,17 +248,10 @@ def loadcontext(object_type, uri, name=None, relative_to=None, def _loadconfig(object_type, uri, path, name, relative_to, global_conf): + isabs = os.path.isabs(path) # De-Windowsify the paths: path = path.replace('\\', '/') - absolute_path = True - if sys.platform == 'win32': - _absolute_re = re.compile(r'^[a-zA-Z]:') - if not _absolute_re.search(path): - absolute_path = False - else: - if not path.startswith('/'): - absolute_path = False - if not absolute_path: + if not isabs: if not relative_to: raise ValueError( "Cannot resolve relative uri %r; no context keyword " -- cgit v1.2.1