Skip to content

Commit

Permalink
(MODPYTHON-143) Allow '~/' shortcut to be used in paths listed in the
Browse files Browse the repository at this point in the history
'mod_python.importer.path' option. This means that paths can be specified
with respect to handler root rather than using absolute paths in Apache
configuration files.
  • Loading branch information
grahamd committed Oct 29, 2006
1 parent 03bff9e commit 2725252
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions lib/python/mod_python/importer.py
Expand Up @@ -197,6 +197,10 @@ def _find_module(module_name, path):

for directory in path:
if directory is not None:
if directory[:2] == '~/':
root = get_handler_root()
if root is not None:
directory = os.path.join(root, directory[2:])
file = os.path.join(directory, module_name) + '.py'
if os.path.exists(file):
return file
Expand Down

0 comments on commit 2725252

Please sign in to comment.