From 953709fdd521b6767e02c87084b550c0861d8f47 Mon Sep 17 00:00:00 2001 From: Anders Kaseorg Date: Sat, 18 Apr 2020 15:23:39 -0700 Subject: [PATCH] =?UTF-8?q?log2zulip:=20Adjust=20for=20zulip=20setup=5Fpat?= =?UTF-8?q?h=5Fon=5Fimport=20=E2=86=92=20setup=5Fpath=20change.?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit https://github.com/zulip/zulip/commit/687553a66122baf162c327e172db35a4b3ba1c13 Signed-off-by: Anders Kaseorg --- zulip/integrations/log2zulip/log2zulip | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/zulip/integrations/log2zulip/log2zulip b/zulip/integrations/log2zulip/log2zulip index bdce5c6..1a5c184 100755 --- a/zulip/integrations/log2zulip/log2zulip +++ b/zulip/integrations/log2zulip/log2zulip @@ -11,12 +11,17 @@ import subprocess import tempfile import traceback +# Use the Zulip virtualenv if available +sys.path.append("/home/zulip/deployments/current") try: - # Use the Zulip virtualenv if available - sys.path.append("/home/zulip/deployments/current") - import scripts.lib.setup_path_on_import + from scripts.lib.setup_path import setup_path + setup_path() except ImportError: - pass + try: + import scripts.lib.setup_path_on_import + scripts.lib.setup_path_on_import # Suppress unused import warning + except ImportError: + pass import json