summaryrefslogtreecommitdiffstats
path: root/py
diff options
context:
space:
mode:
Diffstat (limited to 'py')
-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")