summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDennis Fink2020-12-12 17:02:25 +0100
committerDennis Fink2020-12-12 17:02:25 +0100
commit33d280bd59fc29be4e077964cbb54d0fd7c9eb24 (patch)
tree6aafa87478e71dfd289b0db73619efd784c72461
parent9939e88e16c95526c6a61db45fb0a1a31568a8a0 (diff)
downloadpatternutils-33d280bd59fc29be4e077964cbb54d0fd7c9eb24.tar.gz
patternutils-33d280bd59fc29be4e077964cbb54d0fd7c9eb24.zip
Fix json read if input is not a stream
Diffstat (limited to '')
-rw-r--r--patternutils/commands/pjson.py2
-rw-r--r--patternutils/commands/targs.py2
-rw-r--r--patternutils/commands/tln.py2
-rw-r--r--patternutils/commands/tmv.py2
4 files changed, 4 insertions, 4 deletions
diff --git a/patternutils/commands/pjson.py b/patternutils/commands/pjson.py
index d114d4c..a7bf069 100644
--- a/patternutils/commands/pjson.py
+++ b/patternutils/commands/pjson.py
@@ -83,7 +83,7 @@ def pjson(
if stream:
data = map(utils.json_loads, read_from) # type: ignore
else:
- data = utils.json_loads(read_from)
+ data = utils.json_loads(read_from.read())
matches = []
diff --git a/patternutils/commands/targs.py b/patternutils/commands/targs.py
index 5c5a063..ae8b74d 100644
--- a/patternutils/commands/targs.py
+++ b/patternutils/commands/targs.py
@@ -83,7 +83,7 @@ def targs(
if stream:
data = map(utils.json_loads, read_from)
else:
- data = utils.json_loads(read_from)
+ data = utils.json_loads(read_from.read())
if use_predefined_template:
try:
diff --git a/patternutils/commands/tln.py b/patternutils/commands/tln.py
index 0dec44b..509f4ad 100644
--- a/patternutils/commands/tln.py
+++ b/patternutils/commands/tln.py
@@ -104,7 +104,7 @@ def tln(
if stream:
data = map(utils.json_loads, read_from)
else:
- data = utils.json_loads(read_from)
+ data = utils.json_loads(read_from.read())
if use_predefined_template:
try:
diff --git a/patternutils/commands/tmv.py b/patternutils/commands/tmv.py
index 1f39cc0..5ae2582 100644
--- a/patternutils/commands/tmv.py
+++ b/patternutils/commands/tmv.py
@@ -102,7 +102,7 @@ def tmv(
if stream:
data = map(utils.json_loads, read_from)
else:
- data = utils.json_loads(read_from)
+ data = utils.json_loads(read_from.read())
if use_predefined_template:
try: