From 53d7c5d7abdc3460ccfda9ba57f1f36c05923097 Mon Sep 17 00:00:00 2001 From: Neil Webber Date: Wed, 8 May 2024 08:40:13 -0500 Subject: [PATCH] Fix for typeerror #21 -- though this also points out re-reading what MMR2 points to (for logging) might be a bad idea --- machine.py | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/machine.py b/machine.py index dbddd52..4adb9f9 100644 --- a/machine.py +++ b/machine.py @@ -1043,7 +1043,13 @@ class PDP1170(PDP11): # everything into an octal string. if fmt is oct: for k, v in d.items(): - pfx = '0' if v > 7 else '' - d[k] = pfx + oct(v)[2:] + try: + pfx = '0' if v > 7 else '' + except TypeError: + # Leave non-numeric values unmolested. + # E.g., the "except PDPTrap" case for MMR2 reads + pass + else: + d[k] = pfx + oct(v)[2:] return d