From 2fda66f1ffc7d25359c4399d8cacb50c3a4f0fc8 Mon Sep 17 00:00:00 2001 From: Alon Levy Date: Fri, 10 Apr 2015 18:55:36 +0200 Subject: server-tools/rz: fix candidate test and paths --- src/local/server-tools/rz.py | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) (limited to 'src') 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) -- cgit v1.3.1