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
a49d262a
Commit
a49d262a
authored
May 07, 2009
by
Sidnei da Silva
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
- In Python 2.4, it's a ``builtin method``, not a ``wrapper slot``. Yuck.
parent
ca8f3bcc
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
9 additions
and
3 deletions
+9
-3
src/OFS/SimpleItem.py
src/OFS/SimpleItem.py
+9
-3
No files found.
src/OFS/SimpleItem.py
View file @
a49d262a
...
...
@@ -243,6 +243,7 @@ class Item(Base,
# exception value? To be able to do so, the exception
# constructor needs to be able to take more than two
# arguments (some Zope 3 exceptions can't).
can_raise
=
False
ctor
=
getattr
(
error_type
,
'__init__'
,
None
)
if
inspect
.
ismethoddescriptor
(
ctor
):
# If it's a method descriptor, it means we've got a
...
...
@@ -252,9 +253,14 @@ class Item(Base,
else
:
if
inspect
.
ismethod
(
ctor
):
ctor
=
getattr
(
ctor
,
'im_func'
,
None
)
can_raise
=
(
ctor
is
not
None
and
inspect
.
isfunction
(
ctor
)
and
len
(
inspect
.
getargspec
(
error_type
.
__init__
)[
0
])
>
2
)
if
inspect
.
isbuiltin
(
ctor
):
# In Python 2.4, the ``__init__`` method of the
# base ``Exception`` class is a ``builtin
# method``.
can_raise
=
True
elif
ctor
is
not
None
and
inspect
.
isfunction
(
ctor
):
can_raise
=
(
len
(
inspect
.
getargspec
(
error_type
.
__init__
)[
0
])
>
2
)
if
not
(
can_raise
and
handle_errors
):
# If we have been asked not to handle errors and we
...
...
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