mirror of
https://gitlab.com/apparmor/apparmor
synced 2025-08-22 18:17:09 +00:00
aa_is_enabled now returns a boolean in Python
Because boooleans are a subclass of ints in Python, this isn't a breaking change Signed-off-by: Ryan Lee <ryan.lee@canonical.com>
This commit is contained in:
parent
a15768b0bf
commit
f05112b5e9
@ -122,6 +122,19 @@ extern char *aa_splitcon(char *con, char **mode);
|
|||||||
|
|
||||||
/* apparmor.h */
|
/* apparmor.h */
|
||||||
|
|
||||||
|
/*
|
||||||
|
* aa_is_enabled returns a boolean as an int with failure reason in errno
|
||||||
|
* Therefore, aa_is_enabled either returns True or throws an exception
|
||||||
|
*
|
||||||
|
* Keep that behavior for backwards compatibilty but return a boolean on Python
|
||||||
|
* where it makes more sense, which isn't a breaking change because a boolean is
|
||||||
|
* a subclass of int
|
||||||
|
*/
|
||||||
|
#ifdef SWIGPYTHON
|
||||||
|
%typemap(out) int {
|
||||||
|
$result = PyBool_FromLong($1);
|
||||||
|
}
|
||||||
|
#endif
|
||||||
extern int aa_is_enabled(void);
|
extern int aa_is_enabled(void);
|
||||||
|
|
||||||
/* These should not receive the VOID_Object typemap */
|
/* These should not receive the VOID_Object typemap */
|
||||||
|
Loading…
x
Reference in New Issue
Block a user