Skip to content

Commit e1b1603

Browse files
committed
callwith add code return
1 parent 76d5bb5 commit e1b1603

File tree

1 file changed

+6
-4
lines changed

1 file changed

+6
-4
lines changed

qiniu/rpc.py

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,8 @@ def merged_headers(self, header):
3131
return _header
3232

3333
def call(self, path):
34-
return self.call_with(path, None)
34+
ret, err, code = self.call_with(path, None)
35+
return ret, err
3536

3637
def call_with(self, path, body, content_type=None, content_length=None):
3738
ret = None
@@ -59,9 +60,9 @@ def call_with(self, path, body, content_type=None, content_length=None):
5960
if reqid is not None:
6061
err_msg += ", reqid:%s" % reqid
6162

62-
return None, err_msg
63+
return None, err_msg, resp.status
6364

64-
return ret, None
65+
return ret, None, resp.status
6566

6667
def call_with_multipart(self, path, fields=None, files=None):
6768
"""
@@ -87,7 +88,8 @@ def call_with_form(self, path, ops):
8788
body = '&'.join(body)
8889

8990
content_type = "application/x-www-form-urlencoded"
90-
return self.call_with(path, body, content_type, len(body))
91+
ret, err, code = self.call_with(path, body, content_type, len(body))
92+
return ret, err
9193

9294
def set_header(self, field, value):
9395
self._header[field] = value

0 commit comments

Comments
 (0)