]> git.phdru.name Git - bookmarks_db.git/commitdiff
Fix(subproc.py): Test bogus subprocess at the beginning
authorOleg Broytman <phd@phdru.name>
Sat, 1 Jul 2017 00:34:49 +0000 (03:34 +0300)
committerOleg Broytman <phd@phdru.name>
Sat, 1 Jul 2017 00:34:49 +0000 (03:34 +0300)
When is being run in the middle it meddles with the next process.

subproc.py

index fcb7e1e222715bbea0408062dd73da92b5a13692..d16ecc6064de3dbb28b610e51d6e14816c57767a 100644 (file)
@@ -648,15 +648,15 @@ class Ph:
 #############################################################################
 
 def test(p=0):
-    print("\tOpening subprocess:")
-    p = Subprocess('cat', 1)            # set to expire noisily...
-    print(p)
     print("\tOpening bogus subprocess, should fail:")
     try:
         b = Subprocess('/', 1)
         print("\tOops!  Null-named subprocess startup *succeeded*?!?")
     except SubprocessError:
         print("\t...yep, it failed.")
+    print("\tOpening cat subprocess:")
+    p = Subprocess('cat', 1)            # set to expire noisily...
+    print(p)
     print('\tWrite, then read, two newline-teriminated lines, using readline:')
     p.write('first full line written\n'); p.write('second.\n')
     print(repr(p.readline()))