Skip to content

Commit

Permalink
Added python3 support
Browse files Browse the repository at this point in the history
  • Loading branch information
RemiRigal committed Jun 10, 2021
1 parent dc41c8a commit 2762149
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/actionlib_enhanced/action_server.py
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ def _set_gh_state(self, result=None, text="", succeeded=True):
"""
threadId = threading.current_thread().ident
self.lock.acquire()
if not self.ghDict.has_key(threadId):
if threadId not in self.ghDict:
rospy.logwarn("set_succeeded called more than once in an actionlib server callback or outside one, ignoring call")
return
gh = self.ghDict[threadId]
Expand Down Expand Up @@ -93,7 +93,7 @@ def execute_server_callback(self, goal_handle):
except Exception as e:
rospy.logerr("Error in the actionlib server callback: {}".format(traceback.format_exc()))
finally:
if self.ghDict.has_key(threading.current_thread().ident):
if threading.current_thread().ident in self.ghDict:
rospy.logwarn("The actionlib server callback did not set the goal as succeeded, sending unsuccessful result")
self.set_aborted()

Expand Down Expand Up @@ -136,7 +136,7 @@ def scheduling(self):
sender, _, stamp = goalId.split("-")
stamp = float(stamp)
self.lock.acquire()
if self.electionList.has_key(sender):
if sender in self.electionList:
senderList = self.electionList.get(sender, [])
senderList.append((stamp, goalId))
senderList.sort(key=lambda x : x[0])
Expand Down

0 comments on commit 2762149

Please sign in to comment.