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
493e7e26
Commit
493e7e26
authored
Sep 23, 2022
by
Kazuhiko Shiozaki
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
py2/py3: stop using apply().
parent
126ae257
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
9 additions
and
7 deletions
+9
-7
product/ERP5/tests/erp5_url_checker.py
product/ERP5/tests/erp5_url_checker.py
+1
-1
product/ERP5Type/tests/Python3StyleTest.py
product/ERP5Type/tests/Python3StyleTest.py
+7
-5
product/Formulator/tests/testFormValidator.py
product/Formulator/tests/testFormValidator.py
+1
-1
No files found.
product/ERP5/tests/erp5_url_checker.py
View file @
493e7e26
...
...
@@ -116,7 +116,7 @@ class URLOpener(FancyURLopener):
if
auth
:
h
.
putheader
(
'Authorization'
,
'Basic %s'
%
auth
)
if
realhost
:
h
.
putheader
(
'Host'
,
realhost
)
for
args
in
self
.
addheaders
:
apply
(
h
.
putheader
,
args
)
for
args
in
self
.
addheaders
:
h
.
putheader
(
*
args
)
h
.
endheaders
()
if
data
is
not
None
:
h
.
send
(
data
+
'
\
r
\
n
'
)
...
...
product/ERP5Type/tests/Python3StyleTest.py
View file @
493e7e26
...
...
@@ -75,18 +75,20 @@ class Python3StyleTest(ERP5TypeTestCase):
if
error
:
self
.
fail
(
error
)
def
test_raiseFixApplied
(
self
):
self
.
_testFixer
(
'raise'
)
def
test_importFixApplied
(
self
):
self
.
_testFixer
(
'import'
)
def
test_applyFixApplied
(
self
):
self
.
_testFixer
(
'apply'
)
def
test_hasKeyFixApplied
(
self
):
self
.
_testFixer
(
'has_key'
)
def
test_importFixApplied
(
self
):
self
.
_testFixer
(
'import'
)
def
test_numliteralsFixApplied
(
self
):
self
.
_testFixer
(
'numliterals'
)
def
test_raiseFixApplied
(
self
):
self
.
_testFixer
(
'raise'
)
def
test_suite
():
suite
=
unittest
.
TestSuite
()
...
...
product/Formulator/tests/testFormValidator.py
View file @
493e7e26
...
...
@@ -27,7 +27,7 @@ class TestField:
class
ValidatorTestCase
(
unittest
.
TestCase
):
def
assertValidatorRaises
(
self
,
exception
,
error_key
,
f
,
*
args
,
**
kw
):
try
:
apply
(
f
,
args
,
kw
)
f
(
*
args
,
**
kw
)
except
exception
as
e
:
if
hasattr
(
e
,
'error_key'
)
and
e
.
error_key
!=
error_key
:
self
.
fail
(
'Got wrong error. Expected %s received %s'
%
...
...
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