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
d6db71a7
Commit
d6db71a7
authored
Jan 28, 2002
by
Evan Simpson
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix issubclass() call that fails on string exceptions.
parent
3edf498b
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
21 additions
and
20 deletions
+21
-20
lib/python/Zope/__init__.py
lib/python/Zope/__init__.py
+21
-20
No files found.
lib/python/Zope/__init__.py
View file @
d6db71a7
...
...
@@ -99,30 +99,31 @@ def zpublisher_exception_hook(
published
,
REQUEST
,
t
,
v
,
traceback
,
# static
StringType
=
type
(
''
),
lower
=
string
.
lower
,
ConflictError
=
ZODB
.
POSException
.
ConflictError
,
ListType
=
type
([]),
):
try
:
if
((
type
(
t
)
is
StringType
and
lower
(
t
)
in
(
'unauthorized'
,
'redirect'
))
or
t
is
SystemExit
):
raise
if
issubclass
(
t
,
ConflictError
):
# now what
# First, we need to close the current connection. We'll
# do this by releasing the hold on it. There should be
# some sane protocol for this, but for now we'll use
# brute force:
global
conflict_errors
conflict_errors
=
conflict_errors
+
1
method_name
=
REQUEST
.
get
(
'PATH_INFO'
,
''
)
err
=
(
'ZODB conflict error at %s (%s conflicts since startup '
'at %s)'
)
LOG
(
err
%
(
method_name
,
conflict_errors
,
startup_time
),
INFO
,
''
)
LOG
(
'Conflict traceback'
,
BLATHER
,
''
,
error
=
sys
.
exc_info
())
raise
ZPublisher
.
Retry
(
t
,
v
,
traceback
)
if
t
is
ZPublisher
.
Retry
:
v
.
reraise
()
if
isinstance
(
t
,
StringType
):
if
t
.
lower
()
in
(
'unauthorized'
,
'redirect'
):
raise
else
:
if
t
is
SystemExit
:
raise
if
issubclass
(
t
,
ConflictError
):
# First, we need to close the current connection. We'll
# do this by releasing the hold on it. There should be
# some sane protocol for this, but for now we'll use
# brute force:
global
conflict_errors
conflict_errors
=
conflict_errors
+
1
method_name
=
REQUEST
.
get
(
'PATH_INFO'
,
''
)
err
=
(
'ZODB conflict error at %s '
'(%s conflicts since startup at %s)'
)
LOG
(
err
%
(
method_name
,
conflict_errors
,
startup_time
),
INFO
,
''
)
LOG
(
'Conflict traceback'
,
BLATHER
,
''
,
error
=
sys
.
exc_info
())
raise
ZPublisher
.
Retry
(
t
,
v
,
traceback
)
if
t
is
ZPublisher
.
Retry
:
v
.
reraise
()
if
(
getattr
(
REQUEST
.
get
(
'RESPONSE'
,
None
),
'_error_format'
,
''
)
!=
'text/html'
):
raise
...
...
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