From 94d02f3cf940d0e9e1f23ec0e8845f33105fc8fc Mon Sep 17 00:00:00 2001 From: Michael E Brown Date: Fri, 7 Mar 2008 21:15:44 -0600 Subject: handle idiots with grace and poise. --- py/mock.py | 11 +++++++++++ 1 file changed, 11 insertions(+) (limited to 'py/mock.py') 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, -C") -- cgit