summaryrefslogtreecommitdiffstats
path: root/py
diff options
context:
space:
mode:
authorMichael E Brown <michael_e_brown@dell.com>2007-12-11 18:09:22 -0600
committerMichael E Brown <michael_e_brown@dell.com>2007-12-11 18:09:22 -0600
commitfeaaffe73baa6808eb229041b86cdea6f5c1c56f (patch)
treed88e79dfb3de691c7fee9f4f3cd6475ab779082f /py
parentc4edf71309f230955998fd2922d6045068b31eab (diff)
downloadmock-feaaffe73baa6808eb229041b86cdea6f5c1c56f.tar.gz
mock-feaaffe73baa6808eb229041b86cdea6f5c1c56f.tar.xz
mock-feaaffe73baa6808eb229041b86cdea6f5c1c56f.zip
add warning for when personality has no constant mapping.
Diffstat (limited to 'py')
-rw-r--r--py/mock/util.py7
1 files changed, 6 insertions, 1 deletions
diff --git a/py/mock/util.py b/py/mock/util.py
index f2ddec2..c11c6d4 100644
--- a/py/mock/util.py
+++ b/py/mock/util.py
@@ -200,7 +200,12 @@ _libc.personality.restype = ctypes.c_int
decorate(traceLog())
def condPersonality(per=None):
- if personality_defs.get(per, None) is None: return
+ if per is None:
+ return
+ if personality_defs.get(per, None) is None:
+ getLog().warning("Unable to find predefined setarch personality constant for '%s' arch."
+ " You may have to manually run setarch."% per)
+ return
res = _libc.personality(personality_defs[per])
if res == -1:
raise OSError(_errno.value, os.strerror(_errno.value))