From 4cdc59a3e4671d40273466e59acc686d9338a32f Mon Sep 17 00:00:00 2001 From: reyha Date: Tue, 18 Oct 2016 19:12:15 +0000 Subject: [PATCH] API bindings: Raise error if site param not defined. Stops defaulting the site parameter to the now-nonexistent https://zulip.com, and ask the user to enter the site via --site or ~/.zuliprc if not provided. Fixes #2039. --- zulip/__init__.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/zulip/__init__.py b/zulip/__init__.py index 1ad204f..6aa118f 100644 --- a/zulip/__init__.py +++ b/zulip/__init__.py @@ -219,9 +219,9 @@ class Client(object): site = site.rstrip("/") self.base_url = site else: - self.base_url = "https://api.zulip.com" + raise RuntimeError("Missing Zulip server URL; specify via --site or ~/.zuliprc.") - if self.base_url != "https://api.zulip.com" and not self.base_url.endswith("/api"): + if not self.base_url.endswith("/api"): self.base_url += "/api" self.base_url += "/" self.retry_on_errors = retry_on_errors