From 5a2db81f93747ba372d8d39d7dd36daf3ec7cb04 Mon Sep 17 00:00:00 2001 From: John Johansen Date: Tue, 4 Jun 2019 13:16:43 -0700 Subject: [PATCH] libapparmor python: Fix 'aa_log_record' object has no attribute '__getattr__' When building with swig 4 we are seeing the error AttributeError: 'aa_log_record' object has no attribute '__getattr__' Which forces swig to use modern classes which do not generate __getattr__ methods. issue: https://gitlab.com/apparmor/apparmor/issues/33 Acked-by: Seth Arnold Acked-by: Steve Beattie Signed-off-by: John Johansen (cherry picked from commit a6ac6f4cfcc3d4fe1064087389004c3cc8b41207) --- libraries/libapparmor/swig/python/test/test_python.py.in | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libraries/libapparmor/swig/python/test/test_python.py.in b/libraries/libapparmor/swig/python/test/test_python.py.in index 894a46aaa..378495541 100644 --- a/libraries/libapparmor/swig/python/test/test_python.py.in +++ b/libraries/libapparmor/swig/python/test/test_python.py.in @@ -109,7 +109,7 @@ class AAPythonBindingsTests(unittest.TestCase): new_record = dict() for key in [x for x in dir(record) if not (x.startswith('_') or x == 'this')]: - value = record.__getattr__(key) + value = getattr(record, key) if key == "event" and value in EVENT_MAP: new_record[key] = EVENT_MAP[value] elif key == "version":