Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit 22b6ddb

Browse filesBrowse files
committed
warnings instead of print; not printing ''
1 parent eefa824 commit 22b6ddb
Copy full SHA for 22b6ddb

File tree

Expand file treeCollapse file tree

1 file changed

+8
-7
lines changed
Filter options
Expand file treeCollapse file tree

1 file changed

+8
-7
lines changed

‎plotly/plotly.py

Copy file name to clipboardExpand all lines: plotly/plotly.py
+8-7Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
import requests
22
import json
3+
import warnings
4+
35
from .version import __version__
46

57
def signup(un, email):
@@ -190,15 +192,14 @@ def __makecall(self, args, un, key, origin, kwargs):
190192
payload = {'platform': platform, 'version': __version__, 'args': args, 'un': un, 'key': key, 'origin': origin, 'kwargs': kwargs}
191193
r = requests.post(url, data=payload)
192194
r = json.loads(r.text)
193-
if 'error' in r.keys():
195+
if 'error' in r and r['error'] != '':
194196
print(r['error'])
195-
if 'warning' in r.keys():
196-
print(r['warning'])
197-
if 'message' in r.keys():
198-
if self.verbose:
199-
print(r['message'])
197+
if 'warning' in r and r['warning'] != '':
198+
warnings.warn(r['warning'])
199+
if 'message' in r and r['message'] != '' and self.verbose:
200+
print(r['message'])
200201

201-
if 'filename' in r.keys():
202+
if 'filename' in r:
202203
self.__filename = r['filename']
203204
return r
204205

0 commit comments

Comments
0 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.