PiDP-8/I SoftwareCheck-in [560dc8061a]
Not logged in

Many hyperlinks are disabled.
Use anonymous login to enable hyperlinks.

Overview
Comment:Fixed a case where pexpect is giving us a byte string, which annoys Python's regex matcher. Explicitly converting it to an ASCII text string. It's basically a null operation, but it makes Python 3 happy.
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | os8-run-python3
Files: files | file ages | folders
SHA3-256:560dc8061a4d3b88d08a1d22251d041c39b8932fa540d0b62e5dfa59e0fa03d9
User & Date: tangent 2019-04-16 11:38:20
Context
2019-04-16
11:49
More print() fixes, this time for os8-cp. Leaf check-in: e05a907c3f user: tangent tags: os8-run-python3
11:38
Fixed a case where pexpect is giving us a byte string, which annoys Python's regex matcher. Explicitly converting it to an ASCII text string. It's basically a null operation, but it makes Python 3 happy. check-in: 560dc8061a user: tangent tags: os8-run-python3
2019-04-15
07:33
Merged in the tiny trunk differences relative to the SIMH update accidentally checked in on this branch. Now this branch contains only the Python 2-ism fixes relative to trunk. check-in: 18d667556a user: tangent tags: os8-run-python3
Changes
Hide Diffs Unified Diffs Ignore Whitespace Patch

Changes to lib/os8script.py.

1349
1350
1351
1352
1353
1354
1355

1356
1357

1358
1359

1360
1361
1362
1363
1364
1365
1366
    ucname = line.upper()
    boot_replies = [ucname + "\s+(.+)\r", "Non-existent device"]
    self.simh.send_cmd("show " + line)
    retval = self.simh._child.expect(boot_replies)
    if retval == 1:
      print("Attempt to boot non-existent device: " + line)
      return "die"

    m = re.match("^(\S+)\s(\S+),\s+(attached to |not attached)(\S+)?,\s+(.+)\r",
                 self.simh._child.after)

    if m == None:
      print("Could not determine if device " + line + " is attached.")

      return "die"

    # Caution match group we want ends with a space.
    if m.group(3) != "attached to ":
      print("Attempt to boot on non-attached device: " + line)
      return "die"
    







>

<
>

|
>







1349
1350
1351
1352
1353
1354
1355
1356
1357

1358
1359
1360
1361
1362
1363
1364
1365
1366
1367
1368
    ucname = line.upper()
    boot_replies = [ucname + "\s+(.+)\r", "Non-existent device"]
    self.simh.send_cmd("show " + line)
    retval = self.simh._child.expect(boot_replies)
    if retval == 1:
      print("Attempt to boot non-existent device: " + line)
      return "die"
    reply = self.simh._child.after.decode('ascii')
    m = re.match("^(\S+)\s(\S+),\s+(attached to |not attached)(\S+)?,\s+(.+)\r",

        reply)
    if m == None:
      print("Could not determine if device " + line + " is attached; " +
          "got '" + reply + "'")
      return "die"

    # Caution match group we want ends with a space.
    if m.group(3) != "attached to ":
      print("Attempt to boot on non-attached device: " + line)
      return "die"