chiark
/
gitweb
/
~mdw
/
stgit
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(from parent 1:
f0de3f9
)
Assert that the argument to Run is a sequence of strings
author
Karl Hasselström
<kha@treskal.com>
Fri, 24 Aug 2007 11:26:01 +0000
(13:26 +0200)
committer
Karl Hasselström
<kha@treskal.com>
Sun, 26 Aug 2007 20:04:10 +0000
(22:04 +0200)
This runtime assertion makes bugs easier to find.
In most other languages, we'd have been able to check this at compile
time. But this is Python. Yay!
Signed-off-by: Karl Hasselström <kha@treskal.com>
stgit/run.py
patch
|
blob
|
blame
|
history
diff --git
a/stgit/run.py
b/stgit/run.py
index d925ccea68c6200f9aae90330ec5366a2d06c862..1bc47595b1f9dabb3bffbbf498b27cc839068e9a 100644
(file)
--- a/
stgit/run.py
+++ b/
stgit/run.py
@@
-31,6
+31,9
@@
class Run:
exc = RunException
def __init__(self, *cmd):
self.__cmd = list(cmd)
+ for c in cmd:
+ if type(c) != str:
+ raise Exception, 'Bad command: %r' % cmd
self.__good_retvals = [0]
self.__env = None
self.__indata = None