projects
/
blog.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
ca63a4b
)
Update abcplay.py to handle pre-terminated subprocesses.
author
W. Trevor King
<wking@drexel.edu>
Tue, 16 Nov 2010 17:36:31 +0000
(12:36 -0500)
committer
W. Trevor King
<wking@drexel.edu>
Tue, 16 Nov 2010 17:36:31 +0000
(12:36 -0500)
posts/abcplay/abcplay.py
patch
|
blob
|
history
diff --git
a/posts/abcplay/abcplay.py
b/posts/abcplay/abcplay.py
index a3cd6c7ff4956233db89a7474409752507847f7a..9d840895686659153378f3fc1a1a05f129c244aa 100755
(executable)
--- a/
posts/abcplay/abcplay.py
+++ b/
posts/abcplay/abcplay.py
@@
-72,11
+72,17
@@
class ABCPlayer (object):
def _kill_p(self):
if self._p != None:
- self._p.terminate()
- self._p.wait()
+ try:
+ self._p.terminate()
+ except OSError, e:
+ if e.errno == 3:
+ pass # no such process
+ else:
+ raise
+ else:
+ self._p.wait()
self._p = None
-
if __name__ == '__main__':
import sys