diff options
author | Michael E Brown <michael_e_brown@dell.com> | 2007-12-11 18:09:22 -0600 |
---|---|---|
committer | Michael E Brown <michael_e_brown@dell.com> | 2007-12-11 18:09:22 -0600 |
commit | feaaffe73baa6808eb229041b86cdea6f5c1c56f (patch) | |
tree | d88e79dfb3de691c7fee9f4f3cd6475ab779082f /py | |
parent | c4edf71309f230955998fd2922d6045068b31eab (diff) | |
download | mock-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.py | 7 |
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)) |