From e1eaad381ddb1af70bc12351778b74f9cf98e187 Mon Sep 17 00:00:00 2001 From: Daniel STAN Date: Wed, 3 Jun 2015 19:44:06 +0200 Subject: [PATCH] fix possible import de client.py --- client.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/client.py b/client.py index 5da07a8..65755bf 100755 --- a/client.py +++ b/client.py @@ -33,12 +33,14 @@ try: sys.path.append(os.path.expanduser("~/.config/%s/" % (bootstrap_cmd_name,))) import clientconfig as config except ImportError: - ducktape_display_error = sys.stderr.isatty() and not any([opt in sys.argv for opt in ["-q", "--quiet"]]) + ducktape_display_error = sys.stderr.isatty() and \ + not any([opt in sys.argv for opt in ["-q", "--quiet"]]) and \ + __name__ == '__main__' envspecified = os.getenv(envvar, None) if envspecified is None: if ducktape_display_error: sys.stderr.write(u"Va lire le fichier README.\n".encode("utf-8")) - sys.exit(1) + sys.exit(1) else: # On a spécifié à la main le dossier de conf try: