From 0185c14831f7c52933db084a8e99b057cae2fe7f Mon Sep 17 00:00:00 2001 From: xiez Date: Sun, 8 Jul 2012 20:18:19 +0800 Subject: [PATCH] Fix bug when dict value is 0 --- pysearpc/client.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/pysearpc/client.py b/pysearpc/client.py index 9333a5c..a57167d 100644 --- a/pysearpc/client.py +++ b/pysearpc/client.py @@ -17,9 +17,11 @@ def _fret_int(ret_str): if dicts.has_key('err_code'): raise SearpcError(dicts['err_msg']) - - if dicts['ret']: + + if dicts.has_key('ret'): return dicts['ret'] + else: + raise SearpcError('Invalid response format') def _fret_string(ret_str): try: