Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
S
satella
Manage
Activity
Members
Labels
Plan
Issues
1
Issue boards
Milestones
Wiki
Code
Merge requests
0
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package Registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
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
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
public
satella
Commits
b81d3b98
Commit
b81d3b98
authored
4 years ago
by
Piotr Maślanka
Browse files
Options
Downloads
Patches
Plain Diff
fixed a bug that disabled json if ujson was not installed
parent
e1204710
No related branches found
No related tags found
No related merge requests found
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
CHANGELOG.md
+1
-0
1 addition, 0 deletions
CHANGELOG.md
satella/__init__.py
+1
-1
1 addition, 1 deletion
satella/__init__.py
satella/json.py
+4
-2
4 additions, 2 deletions
satella/json.py
with
6 additions
and
3 deletions
CHANGELOG.md
+
1
−
0
View file @
b81d3b98
# v2.15.7
# v2.15.7
*
deprecated
`IteratorListAdapter`
*
deprecated
`IteratorListAdapter`
*
fixed a bug that disabled json if ujson was not installed
This diff is collapsed.
Click to expand it.
satella/__init__.py
+
1
−
1
View file @
b81d3b98
__version__
=
'
2.15.7a
2
'
__version__
=
'
2.15.7a
3
'
This diff is collapsed.
Click to expand it.
satella/json.py
+
4
−
2
View file @
b81d3b98
...
@@ -76,8 +76,9 @@ def write_json_to_file(path: str, value: JSONAble) -> None:
...
@@ -76,8 +76,9 @@ def write_json_to_file(path: str, value: JSONAble) -> None:
value
=
value
.
to_json
()
value
=
value
.
to_json
()
with
open
(
path
,
'
w
'
)
as
f_out
:
with
open
(
path
,
'
w
'
)
as
f_out
:
try
:
try
:
import
ujson
ujson
.
dump
(
value
,
f_out
)
ujson
.
dump
(
value
,
f_out
)
except
Name
Error
:
except
Import
Error
:
json
.
dump
(
value
,
f_out
)
json
.
dump
(
value
,
f_out
)
...
@@ -113,9 +114,10 @@ def read_json_from_file(path: str) -> JSONAble:
...
@@ -113,9 +114,10 @@ def read_json_from_file(path: str) -> JSONAble:
:raises OSError: the file was not readable or did not exist
:raises OSError: the file was not readable or did not exist
"""
"""
try
:
try
:
import
ujson
with
open
(
path
,
'
r
'
)
as
f_in
:
with
open
(
path
,
'
r
'
)
as
f_in
:
return
ujson
.
load
(
f_in
)
return
ujson
.
load
(
f_in
)
except
Name
Error
:
except
Import
Error
:
with
open
(
path
,
'
r
'
)
as
f_in
:
with
open
(
path
,
'
r
'
)
as
f_in
:
try
:
try
:
return
json
.
load
(
f_in
)
return
json
.
load
(
f_in
)
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment