This repository has been archived by the owner on Oct 2, 2021. It is now read-only.
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Various changes to make imports work
- Loading branch information
Showing
3 changed files
with
22 additions
and
0 deletions.
There are no files selected for viewing
Empty file.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Original file line | Diff line number | Diff line change |
---|---|---|---|
@@ -0,0 +1,21 @@ | |||
import os | |||
import site | |||
import sys | |||
|
|||
base_dir = os.path.dirname(os.path.abspath(__file__)) | |||
|
|||
prev_sys_path = list(sys.path) | |||
|
|||
# site.addsitedir adds this directory to sys.path then scans for .pth files | |||
# and adds them to the path too. | |||
site.addsitedir(os.path.join(base_dir, 'third_party')) | |||
|
|||
# addsitedir adds its directories at the end, but we want our local stuff | |||
# to take precedence over system-installed packages. | |||
# See http://code.google.com/p/modwsgi/issues/detail?id=112 | |||
new_sys_path = [] | |||
for item in list(sys.path): | |||
if item not in prev_sys_path: | |||
new_sys_path.append(item) | |||
sys.path.remove(item) | |||
sys.path[:0] = new_sys_path |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Original file line | Diff line number | Diff line change |
---|---|---|---|
@@ -0,0 +1 @@ | |||
tornado |