OLD | NEW |
(Empty) | |
| 1 import os |
| 2 import sys |
| 3 |
| 4 # The main reason for this hack is: we want this module to be self-contained. |
| 5 # And due to testing setup in the infra repo, appengine/cr_culprit_finder would |
| 6 # be the current working directory during test execution instead of this |
| 7 # directory. But we can't import from appengine/cr_culprit_finder, because the |
| 8 # root directory for app deployment is appengine/cr_culprit_finder/service/* |
| 9 # instead. |
| 10 # |
| 11 # As a side effect, clients importing this module via symbolic links don't have |
| 12 # to explicitly add this directory to the PYTHONPATH or sys.path, because it is |
| 13 # implicitly done here. |
| 14 # |
| 15 # Add to sys.path this directory so that unittests and deployed app won't |
| 16 # complain about modules not found. |
| 17 _THIS_DIR = os.path.dirname(os.path.abspath(__file__)) |
| 18 if _THIS_DIR not in sys.path: |
| 19 sys.path.insert(0, _THIS_DIR) |
OLD | NEW |