From 8999f0a352f6e49f30409e82e08d9417e25b814c Mon Sep 17 00:00:00 2001 From: "neiljp (Neil Pilgrim)" Date: Tue, 5 Jun 2018 22:06:28 -0700 Subject: [PATCH] matrix bridge: Separate print output from sys.exit calls. This appears to be necessary for acquiring the text for testing. --- zulip/integrations/bridge_with_matrix/matrix_bridge.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/zulip/integrations/bridge_with_matrix/matrix_bridge.py b/zulip/integrations/bridge_with_matrix/matrix_bridge.py index b858ef4..107468d 100644 --- a/zulip/integrations/bridge_with_matrix/matrix_bridge.py +++ b/zulip/integrations/bridge_with_matrix/matrix_bridge.py @@ -261,7 +261,8 @@ def main(): try: write_sample_config(options.sample_config, options.zuliprc) except Bridge_ConfigException as exception: - sys.exit(exception) + print("Could not write sample config: {}".format(exception)) + sys.exit(1) if options.zuliprc is None: print("Wrote sample configuration to '{}'".format(options.sample_config)) else: @@ -276,7 +277,8 @@ def main(): try: config = read_configuration(options.config) except Bridge_ConfigException as exception: - sys.exit("Could not parse config file: {}".format(exception)) + print("Could not parse config file: {}".format(exception)) + sys.exit(1) # Get config for each client zulip_config = config["zulip"]