Skip to content

Commit 5c7f14d

Browse files
committed
fix bug
1 parent 887c1f9 commit 5c7f14d

File tree

12 files changed

+16
-8
lines changed

12 files changed

+16
-8
lines changed

pymycobot/__init__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -85,7 +85,7 @@
8585
from pymycobot.mybuddyemoticon import MyBuddyEmoticon
8686
__all__.append("MyBuddyEmoticon")
8787

88-
__version__ = "3.6.5"
88+
__version__ = "3.6.6"
8989
__author__ = "Elephantrobotics"
9090
__email__ = "weiquan.xu@elephantrobotics.com"
9191
__git_url__ = "https://github.com/elephantrobotics/pymycobot"

pymycobot/mecharm270.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -143,6 +143,8 @@ def _res(self, real_command, has_reply, genre):
143143
if genre == ProtocolCode.SET_SSID_PWD:
144144
return None
145145
res = self._process_received(data, genre)
146+
if res is None:
147+
return None
146148
if res is not None and isinstance(res, list) and len(res) == 1 and genre not in [ProtocolCode.GET_BASIC_VERSION,
147149
ProtocolCode.GET_JOINT_MIN_ANGLE,
148150
ProtocolCode.GET_JOINT_MAX_ANGLE,

pymycobot/mecharmsocket.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -136,7 +136,7 @@ def _mesg(self, genre, *args, **kwargs):
136136
if genre == ProtocolCode.SET_SSID_PWD:
137137
return None
138138
res = self._process_received(data, genre)
139-
if res == []:
139+
if res is None:
140140
return None
141141
elif res is not None and isinstance(res, list) and len(res) == 1 and genre not in [
142142
ProtocolCode.GET_BASIC_VERSION,

pymycobot/mybuddy.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -134,7 +134,7 @@ def _mesg(self, genre, *args, **kwargs):
134134
if has_reply:
135135
data = self._read()
136136
res = self._process_received(data, genre, arm=12)
137-
if res == []:
137+
if res is None:
138138
return None
139139
if genre in [
140140
ProtocolCode.ROBOT_VERSION,

pymycobot/mybuddysocket.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -86,7 +86,7 @@ def _mesg(self, genre, *args, **kwargs):
8686
if has_reply:
8787
data = self._read(genre, 'socket')
8888
res = self._process_received(data, genre, arm=12)
89-
if res == []:
89+
if res is None:
9090
return None
9191
if genre in [
9292
ProtocolCode.ROBOT_VERSION,

pymycobot/mycobot.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -107,6 +107,8 @@ def _res(self, real_command, has_reply, genre):
107107
if genre == ProtocolCode.SET_SSID_PWD:
108108
return None
109109
res = self._process_received(data, genre)
110+
if res is None:
111+
return None
110112
if res is not None and isinstance(res, list) and len(res) == 1:
111113
return res[0]
112114
if genre in [

pymycobot/mycobot280.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -147,6 +147,8 @@ def _res(self, real_command, has_reply, genre):
147147
if genre == ProtocolCode.SET_SSID_PWD:
148148
return None
149149
res = self._process_received(data, genre)
150+
if res is None:
151+
return None
150152
if res is not None and isinstance(res, list) and len(res) == 1 and genre not in [ProtocolCode.GET_BASIC_VERSION,
151153
ProtocolCode.GET_JOINT_MIN_ANGLE,
152154
ProtocolCode.GET_JOINT_MAX_ANGLE,

pymycobot/mycobot280socket.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -140,7 +140,7 @@ def _mesg(self, genre, *args, **kwargs):
140140
if genre == ProtocolCode.SET_SSID_PWD:
141141
return None
142142
res = self._process_received(data, genre)
143-
if res == []:
143+
if res is None:
144144
return None
145145
elif res is not None and isinstance(res, list) and len(res) == 1 and genre not in [
146146
ProtocolCode.GET_BASIC_VERSION,

pymycobot/mycobot320.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -159,6 +159,8 @@ def _res(self, real_command, has_reply, genre):
159159
if genre == ProtocolCode.SET_SSID_PWD:
160160
return None
161161
res = self._process_received(data, genre)
162+
if res is None:
163+
return None
162164
if res is not None and isinstance(res, list) and len(res) == 1 and genre not in [ProtocolCode.GET_BASIC_VERSION,
163165
ProtocolCode.GET_JOINT_MIN_ANGLE,
164166
ProtocolCode.GET_JOINT_MAX_ANGLE,

pymycobot/mycobot320socket.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -150,7 +150,7 @@ def _mesg(self, genre, *args, **kwargs):
150150
if genre == ProtocolCode.SET_SSID_PWD:
151151
return None
152152
res = self._process_received(data, genre)
153-
if res == []:
153+
if res is None:
154154
return None
155155
elif res is not None and isinstance(res, list) and len(res) == 1 and genre not in [
156156
ProtocolCode.GET_BASIC_VERSION,

0 commit comments

Comments
 (0)