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
c89b794c
Commit
c89b794c
authored
Jun 17, 2003
by
Brian Lloyd
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix for 641
parent
946b6a98
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
12 additions
and
2 deletions
+12
-2
lib/python/ZPublisher/BeforeTraverse.py
lib/python/ZPublisher/BeforeTraverse.py
+12
-2
No files found.
lib/python/ZPublisher/BeforeTraverse.py
View file @
c89b794c
...
...
@@ -10,10 +10,11 @@
# FOR A PARTICULAR PURPOSE
#
##############################################################################
__version__
=
'$Revision: 1.1
0
$'
[
11
:
-
2
]
__version__
=
'$Revision: 1.1
1
$'
[
11
:
-
2
]
"""BeforeTraverse interface and helper classes"""
from
Acquisition
import
aq_base
from
zLOG
import
LOG
,
ERROR
import
sys
...
...
@@ -129,7 +130,16 @@ class NameCaller:
except
AttributeError
:
return
args
=
getattr
(
getattr
(
meth
,
'func_code'
,
None
),
'co_argcount'
,
2
)
# The code below can acquire "func_code" from an unrelated object
# on the acquisition chain.
# This happens especially, if "meth" is a "CookieCrumber" instance,
# i.e. in a CMF Portal, if a DTMLMethod (or a similar object
# with a fake "func_code" is in the acquisition context
#args = getattr(getattr(meth, 'func_code', None), 'co_argcount', 2)
args
=
getattr
(
getattr
(
aq_base
(
meth
),
'func_code'
,
None
),
'co_argcount'
,
2
)
try
:
apply
(
meth
,
(
container
,
request
,
None
)[:
args
])
except
(
ArithmeticError
,
AttributeError
,
FloatingPointError
,
...
...
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