diff options
| author | Dennis Fink | 2019-08-24 19:15:27 +0200 |
|---|---|---|
| committer | Dennis Fink | 2019-08-24 19:15:27 +0200 |
| commit | 00814e54427068f2aafc503f8ab73bf36df7b5cd (patch) | |
| tree | c1ac1e3808b12895923e1b95eebc7b74a82816f3 | |
| parent | 4418c602da5bd75981c1fd61ab4aacab098b6183 (diff) | |
| download | patternutils-00814e54427068f2aafc503f8ab73bf36df7b5cd.tar.gz patternutils-00814e54427068f2aafc503f8ab73bf36df7b5cd.zip | |
Use list comprehension
| -rw-r--r-- | patternutils/commands/tmv.py | 4 |
1 files changed, 1 insertions, 3 deletions
diff --git a/patternutils/commands/tmv.py b/patternutils/commands/tmv.py index 660293c..25932bc 100644 --- a/patternutils/commands/tmv.py +++ b/patternutils/commands/tmv.py @@ -70,9 +70,7 @@ def tmv( if not stream: data = json.load(read_from) # type: ignore else: - data = [] - for line in read_from: - data.append(json.loads(line)) + data = [json.loads(line) for line in read_from] except json.JSONDecodeError: click.secho('JSON not valid!', fg='red', err=True) raise SystemExit |
