Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
DuniterPy
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Model registry
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
clients
python
DuniterPy
Merge requests
!132
Update black to v21.4b2, handle pylint v2.8.0
Code
Review changes
Check out branch
Download
Patches
Plain diff
Merged
Update black to v21.4b2, handle pylint v2.8.0
black_21.4
into
dev
Overview
1
Commits
2
Pipelines
7
Changes
3
Merged
Moul
requested to merge
black_21.4
into
dev
4 years ago
Overview
1
Commits
2
Pipelines
7
Changes
3
Expand
Update black to v21.4b2
Use
with * as
and remove
close()
Handle new
pylint v2.8.0
consider-using-with
check
Edited
4 years ago
by
Moul
0
0
Merge request reports
Compare
dev
version 3
f6fe45c7
4 years ago
version 2
e14417d6
4 years ago
version 1
22b5bef9
4 years ago
dev (base)
and
latest version
latest version
e14417d6
2 commits,
4 years ago
version 3
f6fe45c7
3 commits,
4 years ago
version 2
e14417d6
2 commits,
4 years ago
version 1
22b5bef9
1 commit,
4 years ago
3 files
+
23
−
24
Inline
Compare changes
Side-by-side
Inline
Show whitespace changes
Show one file at a time
Files
3
Search (e.g. *.vue) (Ctrl+P)
duniterpy/api/client.py
+
20
−
20
Options
@@ -257,27 +257,27 @@ class API:
self
.
connection_handler
.
proxy
,
self
.
connection_handler
.
http_scheme
)
response
=
request
.
urlopen
(
duniter_request
,
timeout
=
15
)
# type: HTTPResponse
if
response
.
status
!=
200
:
with
request
.
urlopen
(
duniter_request
,
timeout
=
15
)
as
response
:
# type: HTTPResponse
if
response
.
status
!=
200
:
content
=
response
.
read
().
decode
(
"
utf-8
"
)
if
bma_errors
:
try
:
error_data
=
parse_error
(
content
)
raise
DuniterError
(
error_data
)
except
(
TypeError
,
jsonschema
.
ValidationError
)
as
exception
:
raise
ValueError
(
"
status code != 200 => %d (%s)
"
%
(
response
.
status
,
content
)
)
from
exception
raise
ValueError
(
"
status code != 200 => %d (%s)
"
%
(
response
.
status
,
content
)
)
# get response content
return_response
=
copy
.
copy
(
response
)
content
=
response
.
read
().
decode
(
"
utf-8
"
)
if
bma_errors
:
try
:
error_data
=
parse_error
(
content
)
raise
DuniterError
(
error_data
)
except
(
TypeError
,
jsonschema
.
ValidationError
)
as
exception
:
raise
ValueError
(
"
status code != 200 => %d (%s)
"
%
(
response
.
status
,
content
)
)
from
exception
raise
ValueError
(
"
status code != 200 => %d (%s)
"
%
(
response
.
status
,
content
)
)
# get response content
return_response
=
copy
.
copy
(
response
)
content
=
response
.
read
().
decode
(
"
utf-8
"
)
response
.
close
()
# if schema supplied...
if
schema
is
not
None
:
Loading