From cb6b525c86c67ae44bab0c9ea5e1a1666c418261 Mon Sep 17 00:00:00 2001 From: Pratikrocks Date: Wed, 15 Apr 2020 01:56:28 +0530 Subject: [PATCH] changed .iteritems() to items() Signed-off-by: Pratikrocks --- src/deltacode/__init__.py | 5 ++--- src/deltacode/cli.py | 2 +- 2 files changed, 3 insertions(+), 4 deletions(-) diff --git a/src/deltacode/__init__.py b/src/deltacode/__init__.py index 4aa06468..02dc3198 100644 --- a/src/deltacode/__init__.py +++ b/src/deltacode/__init__.py @@ -195,9 +195,8 @@ def determine_moved(self): added = self.index_deltas('sha1', [i for i in self.deltas if i.old_file is None and i.new_file]) removed = self.index_deltas('sha1', [i for i in self.deltas if i.old_file and i.new_file is None]) - # TODO: should it be iteritems() or items() - for added_sha1, added_deltas in added.iteritems(): - for removed_sha1, removed_deltas in removed.iteritems(): + for added_sha1, added_deltas in added.items(): + for removed_sha1, removed_deltas in removed.items(): # check for matching sha1s on both sides if utils.check_moved(added_sha1, added_deltas, removed_sha1, removed_deltas): diff --git a/src/deltacode/cli.py b/src/deltacode/cli.py index fc3c0e48..5875621a 100644 --- a/src/deltacode/cli.py +++ b/src/deltacode/cli.py @@ -69,7 +69,7 @@ def print_version(ctx, param, value): @click.option('--version', is_flag=True, is_eager=True, expose_value=False, callback=print_version, help='Show the version and exit.') @click.option('-n', '--new', required=True, prompt=False, type=click.Path(exists=True, readable=True), help='Identify the path to the "new" scan file') @click.option('-o', '--old', required=True, prompt=False, type=click.Path(exists=True, readable=True), help='Identify the path to the "old" scan file') -@click.option('-j', '--json-file', prompt=False, default='-', type=click.File(mode='wb', lazy=False), help='Identify the path to the .json output file') +@click.option('-j', '--json-file', prompt=False, default='-', type=click.File(mode='w', lazy=False), help='Identify the path to the .json output file') @click.option('-a', '--all-delta-types', is_flag=True, help="Include unmodified files as well as all changed files in the .json output. If not selected, only changed files are included.") def cli(new, old, json_file, all_delta_types): """