Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Z
Zope
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Kirill Smelkov
Zope
Commits
0682879a
Commit
0682879a
authored
Feb 18, 2004
by
Jeremy Hylton
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add two checks for errors from Python C API.
parent
c7d58894
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
30 additions
and
22 deletions
+30
-22
lib/python/AccessControl/cAccessControl.c
lib/python/AccessControl/cAccessControl.c
+30
-22
No files found.
lib/python/AccessControl/cAccessControl.c
View file @
0682879a
...
...
@@ -36,7 +36,7 @@
USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH
DAMAGE.
$Id: cAccessControl.c,v 1.2
8 2004/02/18 11:24:51 jim
Exp $
$Id: cAccessControl.c,v 1.2
9 2004/02/18 17:55:43 jeremy
Exp $
If you have questions regarding this software,
contact:
...
...
@@ -1899,6 +1899,8 @@ c_rolesForPermissionOn(PyObject *perm, PyObject *object,
goto
end
;
result
=
PySequence_Concat
(
r
,
list_roles
);
Py_DECREF
(
list_roles
);
if
(
result
==
NULL
)
goto
end
;
}
goto
end
;
}
...
...
@@ -1935,26 +1937,32 @@ c_rolesForPermissionOn(PyObject *perm, PyObject *object,
r = list(roles)
else: r = r + list(roles)
*/
else
if
(
PyObject_IsTrue
(
roles
))
{
PyObject
*
list_roles
=
PySequence_List
(
roles
);
Py_DECREF
(
roles
);
if
(
list_roles
==
NULL
)
goto
end
;
if
(
r
==
Py_None
)
{
Py_DECREF
(
r
);
r
=
list_roles
;
}
else
{
PyObject
*
tmp
=
PySequence_Concat
(
r
,
list_roles
);
Py_DECREF
(
list_roles
);
if
(
tmp
==
NULL
)
goto
end
;
Py_DECREF
(
r
);
r
=
tmp
;
}
else
{
int
bool
=
PyObject_IsTrue
(
roles
);
if
(
bool
<
0
)
goto
end
;
if
(
bool
)
{
PyObject
*
list_roles
=
PySequence_List
(
roles
);
Py_DECREF
(
roles
);
if
(
list_roles
==
NULL
)
goto
end
;
if
(
r
==
Py_None
)
{
Py_DECREF
(
r
);
r
=
list_roles
;
}
else
{
PyObject
*
tmp
=
PySequence_Concat
(
r
,
list_roles
);
Py_DECREF
(
list_roles
);
if
(
tmp
==
NULL
)
goto
end
;
Py_DECREF
(
r
);
r
=
tmp
;
}
}
}
}
...
...
@@ -2305,7 +2313,7 @@ void initcAccessControl(void) {
module
=
Py_InitModule3
(
"cAccessControl"
,
cAccessControl_methods
,
"$Id: cAccessControl.c,v 1.2
8 2004/02/18 11:24:51 jim
Exp $
\n
"
);
"$Id: cAccessControl.c,v 1.2
9 2004/02/18 17:55:43 jeremy
Exp $
\n
"
);
aq_init
();
/* For Python <= 2.1.1, aq_init() should be after
Py_InitModule(). */
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment