diff options
| -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) |
