mirror of
https://gitlab.com/apparmor/apparmor.git
synced 2025-03-04 08:24:42 +01: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
1 changed files with 13 additions and 0 deletions
|
@ -122,6 +122,19 @@ extern char *aa_splitcon(char *con, char **mode);
|
|||
|
||||
/* 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);
|
||||
|
||||
/* These should not receive the VOID_Object typemap */
|
||||
|
|
Loading…
Add table
Reference in a new issue