Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
erp5
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Labels
Merge Requests
139
Merge Requests
139
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Jobs
Commits
Open sidebar
nexedi
erp5
Commits
411b1661
Commit
411b1661
authored
2 years ago
by
Kazuhiko Shiozaki
Committed by
Jérome Perrin
1 year ago
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
py2/py3: use exception.args[] instead of exception[].
parent
47695044
No related merge requests found
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
11 additions
and
11 deletions
+11
-11
product/ZMySQLDA/db.py
product/ZMySQLDA/db.py
+10
-10
product/ZMySQLDA/tests/testDeferredConnection.py
product/ZMySQLDA/tests/testDeferredConnection.py
+1
-1
No files found.
product/ZMySQLDA/db.py
View file @
411b1661
...
...
@@ -405,14 +405,14 @@ class DB(TM):
try
:
self
.
db
.
query
(
query
)
except
OperationalError
as
m
:
if
m
[
0
]
in
query_syntax_error
:
raise
OperationalError
(
m
[
0
],
'%s: %s'
%
(
m
[
1
],
query
))
if
m
[
0
]
in
lock_error
:
raise
ConflictError
(
'%s: %s: %s'
%
(
m
[
0
],
m
[
1
],
query
))
if
m
[
0
]
in
query_timeout_error
:
raise
TimeoutReachedError
(
'%s: %s: %s'
%
(
m
[
0
],
m
[
1
],
query
))
if
m
.
args
[
0
]
in
query_syntax_error
:
raise
OperationalError
(
m
.
args
[
0
],
'%s: %s'
%
(
m
.
args
[
1
],
query
))
if
m
.
args
[
0
]
in
lock_error
:
raise
ConflictError
(
'%s: %s: %s'
%
(
m
.
args
[
0
],
m
.
args
[
1
],
query
))
if
m
.
args
[
0
]
in
query_timeout_error
:
raise
TimeoutReachedError
(
'%s: %s: %s'
%
(
m
.
args
[
0
],
m
.
args
[
1
],
query
))
if
(
allow_reconnect
or
not
self
.
_use_TM
)
and
\
m
[
0
]
in
hosed_connection
:
m
.
args
[
0
]
in
hosed_connection
:
self
.
_forceReconnection
()
self
.
db
.
query
(
query
)
else
:
...
...
@@ -429,8 +429,8 @@ class DB(TM):
try
:
return
self
.
db
.
store_result
()
except
OperationalError
as
m
:
if
m
[
0
]
in
query_timeout_error
:
raise
TimeoutReachedError
(
'%s: %s: %s'
%
(
m
[
0
],
m
[
1
],
query
))
if
m
.
args
[
0
]
in
query_timeout_error
:
raise
TimeoutReachedError
(
'%s: %s: %s'
%
(
m
.
args
[
0
],
m
.
args
[
1
],
query
))
else
:
raise
...
...
@@ -533,7 +533,7 @@ class DB(TM):
except
OperationalError
as
m
:
LOG
(
'ZMySQLDA'
,
ERROR
,
"exception during _abort"
,
error
=
True
)
if
m
[
0
]
not
in
hosed_connection
:
if
m
.
args
[
0
]
not
in
hosed_connection
:
raise
def
getMaxAllowedPacket
(
self
):
...
...
This diff is collapsed.
Click to expand it.
product/ZMySQLDA/tests/testDeferredConnection.py
View file @
411b1661
...
...
@@ -137,7 +137,7 @@ class TestDeferredConnection(ERP5TypeTestCase):
try
:
self
.
commit
()
except
OperationalError
as
m
:
if
m
[
0
]
not
in
hosed_connection
:
if
m
.
args
[
0
]
not
in
hosed_connection
:
raise
else
:
self
.
fail
()
...
...
This diff is collapsed.
Click to expand it.
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