From 943a89490381e54f9b017b80e6de93e31984179e Mon Sep 17 00:00:00 2001 From: Ponni-M Date: Sun, 18 Apr 2021 20:29:45 +0530 Subject: [PATCH] Fixing statis analysis in fetch_upload --- zulip/zulip/__init__.py | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/zulip/zulip/__init__.py b/zulip/zulip/__init__.py index 65773c5fe..48dbc26e2 100644 --- a/zulip/zulip/__init__.py +++ b/zulip/zulip/__init__.py @@ -465,7 +465,7 @@ def get_user_agent(self) -> str: ) def do_api_query(self, orig_request: Mapping[str, Any], url: str, method: str = "POST", - longpolling: bool = False, files: Optional[List[IO[Any]]] = None, timeout: Optional[float] = None, + longpolling: bool = False, files: Optional[List[IO[Any]]] = None, timeout: Optional[float] = None, accesswithAPI: bool = True) -> Dict[str, Any]: if files is None: files = [] @@ -527,7 +527,7 @@ def end_error_retry(succeeded: bool) -> None: if accesswithAPI: if not api_url.endswith(API_STRING): api_url += API_STRING - api_url += "/" + api_url += "/" else: if api_url.endswith(API_STRING): api_url = api_url[:-len(API_STRING)] @@ -608,7 +608,7 @@ def end_error_retry(succeeded: bool) -> None: "status_code": res.status_code} def call_endpoint(self, url: Optional[str] = None, method: str = "POST", request: Optional[Dict[str, Any]] = None, - longpolling: bool = False, files: Optional[List[IO[Any]]] = None, timeout: Optional[float] = None, + longpolling: bool = False, files: Optional[List[IO[Any]]] = None, timeout: Optional[float] = None, accessVersionedAPI: bool = True) -> Dict[str, Any]: if request is None: request = dict() @@ -754,10 +754,9 @@ def fetch_upload(self) -> Dict[str, Any]: ''' See examples/upload-file for example usage. ''' - return self.call_endpoint( url='user_uploads', - method = 'GET', + method = 'GET', accessVersionedAPI = False )