summaryrefslogtreecommitdiffstats
path: root/Demo/scripts/lpwatch.py
diff options
context:
space:
mode:
Diffstat (limited to 'Demo/scripts/lpwatch.py')
-rwxr-xr-xDemo/scripts/lpwatch.py9
1 files changed, 5 insertions, 4 deletions
diff --git a/Demo/scripts/lpwatch.py b/Demo/scripts/lpwatch.py
index 0af3cbd..8887dee 100755
--- a/Demo/scripts/lpwatch.py
+++ b/Demo/scripts/lpwatch.py
@@ -103,7 +103,8 @@ def makestatus(name, thisuser):
lines.append('lpq exit status %r' % (sts,))
return string.joinfields(lines, ': ')
-try:
- main()
-except KeyboardInterrupt:
- pass
+if __name__ == "__main__":
+ try:
+ main()
+ except KeyboardInterrupt:
+ pass