Skip to content

Commit

Permalink
Fix wrong ordering of contextmanagers (rytilahti#976)
Browse files Browse the repository at this point in the history
  • Loading branch information
rytilahti authored and xvlady committed May 9, 2021
1 parent 0e29a4f commit 8ec2fc6
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
6 changes: 3 additions & 3 deletions miio/vacuum.py
Original file line number Diff line number Diff line change
Expand Up @@ -754,9 +754,9 @@ def callback(ctx, *args, id_file, **kwargs):
kwargs["debug"] = gco.debug

start_id = manual_seq = 0
with open(id_file, "r") as f, contextlib.suppress(
FileNotFoundError, TypeError, ValueError
):
with contextlib.suppress(FileNotFoundError, TypeError, ValueError), open(
id_file, "r"
) as f:
x = json.load(f)
start_id = x.get("seq", 0)
manual_seq = x.get("manual_seq", 0)
Expand Down
6 changes: 3 additions & 3 deletions miio/vacuum_cli.py
Original file line number Diff line number Diff line change
Expand Up @@ -58,9 +58,9 @@ def cli(ctx, ip: str, token: str, debug: int, id_file: str):
sys.exit(-1)

start_id = manual_seq = 0
with open(id_file, "r") as f, contextlib.suppress(
FileNotFoundError, TypeError, ValueError
):
with contextlib.suppress(FileNotFoundError, TypeError, ValueError), open(
id_file, "r"
) as f:
x = json.load(f)
start_id = x.get("seq", 0)
manual_seq = x.get("manual_seq", 0)
Expand Down

0 comments on commit 8ec2fc6

Please sign in to comment.