Skip to content

Commit 9589e48

Browse files
committed
BF: get rid of various (debug) messages from iohub
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
1 parent b6a5241 commit 9589e48

File tree

2 files changed

+9
-5
lines changed

2 files changed

+9
-5
lines changed

psychopy/iohub/client/__init__.py

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -62,8 +62,8 @@ def __call__(self, *args, **kwargs):
6262
self.method_name, args, kwargs))
6363

6464
if r is None:
65-
print("r is None:",('EXP_DEVICE', 'DEV_RPC', self.device_class,
66-
self.method_name, args, kwargs))
65+
# print("r is None:",('EXP_DEVICE', 'DEV_RPC', self.device_class,
66+
# self.method_name, args, kwargs))
6767
return None
6868

6969
r = r[1:]
@@ -1280,15 +1280,16 @@ def _shutDownServer(self):
12801280
self._shutdown_attempted = True
12811281
TimeoutError = psutil.TimeoutExpired
12821282
try:
1283-
self.udp_client.sendTo(('STOP_IOHUB_SERVER',))
1284-
self.udp_client.close()
1283+
if self.udp_client: # if it isn't already garbage-collected
1284+
self.udp_client.sendTo(('STOP_IOHUB_SERVER',))
1285+
self.udp_client.close()
12851286
if Computer.iohub_process:
12861287
r = Computer.iohub_process.wait(timeout=5)
12871288
print('ioHub Server Process Completed With Code: ', r)
12881289
except TimeoutError:
12891290
print('Warning: TimeoutExpired, Killing ioHub Server process.')
12901291
Computer.iohub_process.kill()
1291-
except Exception: # pylint: disable=broad-except
1292+
except Exception: # pylint: disable=broad-except
12921293
print("Warning: Unhandled Exception. "
12931294
"Killing ioHub Server process.")
12941295
if Computer.iohub_process:

psychopy/iohub/server.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -106,6 +106,9 @@ def handle(self, request, replyTo):
106106
result = None
107107
try:
108108
result = getattr(self, unicode(callable_name, 'utf-8'))
109+
except TypeError as e:
110+
if "decoding str is not supported" in e:
111+
pass
109112
except Exception:
110113
print2err('RPC_ATTRIBUTE_ERROR')
111114
printExceptionDetailsToStdErr()

0 commit comments

Comments
 (0)