Skip to content

Commit

Permalink
BF: get rid of various (debug) messages from iohub
Browse files Browse the repository at this point in the history
iohub was reporting `r is None` repeatedly for every keyboard check with
no keys. Looks like a debug(?) message added in
a22d02b

fixes GH-3249

I was also getting:

- (harmless) shutdown errors from self.udp_client was already
garbage-collected before it was asked to close()
- RPC_ATTRIBUTE_ERROR was being reported for each failure to
  • Loading branch information
peircej committed Nov 27, 2020
1 parent b6a5241 commit 9589e48
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 5 deletions.
11 changes: 6 additions & 5 deletions psychopy/iohub/client/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -62,8 +62,8 @@ def __call__(self, *args, **kwargs):
self.method_name, args, kwargs))

if r is None:
print("r is None:",('EXP_DEVICE', 'DEV_RPC', self.device_class,
self.method_name, args, kwargs))
# print("r is None:",('EXP_DEVICE', 'DEV_RPC', self.device_class,
# self.method_name, args, kwargs))
return None

r = r[1:]
Expand Down Expand Up @@ -1280,15 +1280,16 @@ def _shutDownServer(self):
self._shutdown_attempted = True
TimeoutError = psutil.TimeoutExpired
try:
self.udp_client.sendTo(('STOP_IOHUB_SERVER',))
self.udp_client.close()
if self.udp_client: # if it isn't already garbage-collected
self.udp_client.sendTo(('STOP_IOHUB_SERVER',))
self.udp_client.close()
if Computer.iohub_process:
r = Computer.iohub_process.wait(timeout=5)
print('ioHub Server Process Completed With Code: ', r)
except TimeoutError:
print('Warning: TimeoutExpired, Killing ioHub Server process.')
Computer.iohub_process.kill()
except Exception: # pylint: disable=broad-except
except Exception: # pylint: disable=broad-except
print("Warning: Unhandled Exception. "
"Killing ioHub Server process.")
if Computer.iohub_process:
Expand Down
3 changes: 3 additions & 0 deletions psychopy/iohub/server.py
Original file line number Diff line number Diff line change
Expand Up @@ -106,6 +106,9 @@ def handle(self, request, replyTo):
result = None
try:
result = getattr(self, unicode(callable_name, 'utf-8'))
except TypeError as e:
if "decoding str is not supported" in e:
pass
except Exception:
print2err('RPC_ATTRIBUTE_ERROR')
printExceptionDetailsToStdErr()
Expand Down

0 comments on commit 9589e48

Please sign in to comment.