summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMichael E Brown <mebrown@michaels-house.net>2008-03-07 21:15:44 -0600
committerMichael E Brown <mebrown@michaels-house.net>2008-03-07 21:15:44 -0600
commit94d02f3cf940d0e9e1f23ec0e8845f33105fc8fc (patch)
tree2e91e24f8c7e333f0c7839c2cde100552e275675
parent4209ee74efad6c9554ffb22e18c27f19bf9b793b (diff)
downloadmock-94d02f3cf940d0e9e1f23ec0e8845f33105fc8fc.tar.gz
mock-94d02f3cf940d0e9e1f23ec0e8845f33105fc8fc.tar.xz
mock-94d02f3cf940d0e9e1f23ec0e8845f33105fc8fc.zip
handle idiots with grace and poise.
-rwxr-xr-xpy/mock.py11
1 files changed, 11 insertions, 0 deletions
diff --git a/py/mock.py b/py/mock.py
index 9935b30..9efd4bf 100755
--- a/py/mock.py
+++ b/py/mock.py
@@ -637,6 +637,17 @@ if __name__ == '__main__':
except (SystemExit,):
raise
+ except (OSError,), e:
+ if e.errno == 1:
+ print
+ log.error("%s" % str(e))
+ print
+ log.error("The most common cause for this error is trying to run /usr/sbin/mock as an unprivileged user.")
+ log.error("Check your path to make sure that /usr/bin/ is listed before /usr/sbin, or manually run /usr/bin/mock to see if that fixes this problem.")
+ print
+ else:
+ raise
+
except (KeyboardInterrupt,):
exitStatus = 7
log.error("Exiting on user interrupt, <CTRL>-C")