diff options
| author | Alon Levy <alon@pobox.com> | 2015-04-10 18:55:36 +0200 |
|---|---|---|
| committer | Alon Levy <alon@pobox.com> | 2015-04-10 18:55:36 +0200 |
| commit | 2fda66f1ffc7d25359c4399d8cacb50c3a4f0fc8 (patch) | |
| tree | 6b9c7e047b64810b44437e0b9a8caba3d6479faf /src | |
| parent | 4ae683cf150ff2253dda4da5efe8bb4204cd703d (diff) | |
server-tools/rz: fix candidate test and paths
Diffstat (limited to 'src')
| -rw-r--r-- | src/local/server-tools/rz.py | 11 |
1 files changed, 6 insertions, 5 deletions
diff --git a/src/local/server-tools/rz.py b/src/local/server-tools/rz.py index 52c9ed83..158be707 100644 --- a/src/local/server-tools/rz.py +++ b/src/local/server-tools/rz.py @@ -3,12 +3,13 @@ import sys import os # to work both from source dir and from deployment dir -candidate = None -for down in [['..', '..'], ['..']]: - candidate = os.path.join(*([os.path.dirname(__file__)] + down + ['server'])) +path = None +for postfix in [['..'], ['..', '..', 'server']]: + candidate = os.path.join(*([os.path.dirname(__file__)] + postfix)) if os.path.exists(candidate): + path = candidate break -if None is candidate: +if None is path: print("must be run from one or two directories above server") raise SystemExit -sys.path.append(candidate) +sys.path.append(path) |
