From 8d130ad96dd07a977ba67715ba39de8968f6fb0d Mon Sep 17 00:00:00 2001 From: Jason Fried Date: Fri, 4 Oct 2019 15:22:09 -0700 Subject: [PATCH] pep-479 codemod Summary: https://www.python.org/dev/peps/pep-0479/ If you are in a generator (a function that uses "yield") you are never allowed to raise StopIteration instead you should just `return` or pass out of scope (implicit return None) Reviewed By: thatch Differential Revision: D17749640 fbshipit-source-id: 9f1be673cf877ff193a0379a0208d037dd2d7bae --- edenscm/hgext/snapshot/cmds.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/edenscm/hgext/snapshot/cmds.py b/edenscm/hgext/snapshot/cmds.py index 512345c269..59a1df2777 100644 --- a/edenscm/hgext/snapshot/cmds.py +++ b/edenscm/hgext/snapshot/cmds.py @@ -190,7 +190,7 @@ def _diff(orig, repo, *args, **kwargs): node2 = kwargs.get("node2") or args[1] if node2 is None: # this should be the snapshot node - raise StopIteration + return ctx2 = repo.unfiltered()[node2] date2 = util.datestr(ctx2.date()) node1 = kwargs.get("node1") or args[0] @@ -203,7 +203,7 @@ def _diff(orig, repo, *args, **kwargs): metadataid = ctx2.extra().get("snapshotmetadataid", "") if not metadataid: # node2 is not a snapshot - raise StopIteration + return snapmetadata = snapshotmetadata.getfromlocalstorage(repo, metadataid) store = repo.svfs.snapshotstore # print unknown files from snapshot