forked from simplejson/simplejson
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Documentation and a test for the previous commit
- Loading branch information
Showing
2 changed files
with
42 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -171,7 +171,7 @@ def __init__(self, skipkeys=False, ensure_ascii=True, | |
self.namedtuple_as_object = namedtuple_as_object | ||
self.tuple_as_array = tuple_as_array | ||
try: | ||
indent = ' ' * indent | ||
indent = indent * ' ' | ||
This comment has been minimized.
Sorry, something went wrong.
This comment has been minimized.
Sorry, something went wrong.
kini
Author
Owner
|
||
except TypeError: | ||
pass | ||
self.indent = indent | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
In making the class for the test, I noticed that I needed this further change. In my original use case, the class, or perhaps some other mechanism in the environment there, seems to be smart enough even to be able to handle
' ' * indent
, but my toy example (and thus perhaps other users' examples) cannot. This diff chunk is not a regression fix, though, because such objects wouldn't have worked anyway before the indent parameter to theJSONEncoder
constructor was made a string instead of an int, as far as I understand. (?)