Browse Source

fix bugs

fix bugs
vivre 8 years ago
parent
commit
b60084e4c9
1 changed files with 5 additions and 2 deletions
  1. 5 2
      wxbot.py

+ 5 - 2
wxbot.py

@@ -1116,9 +1116,12 @@ class WXBot:
         return dic['BaseResponse']['Ret'] == 0
 
     def test_sync_check(self):
-        for host in ['webpush.wx', 'webpush2.wx','webpush.weixin', 'webpush2.weixin2']:
+        for host in ['webpush.wx', 'webpush2.wx2','webpush.weixin', 'webpush2.weixin2']:
             self.sync_host = host
-            retcode = self.sync_check()[0]
+            try:
+                retcode = self.sync_check()[0]
+            except:
+                retcode == -1
             if retcode == '0':
                 return True
         return False