Skip to content

Commit

Permalink
style: use walrus in conditional
Browse files Browse the repository at this point in the history
Co-authored-by: pixeebot[bot] <23113631+pixeebot@users.noreply.github.com>
Co-authored-by: Danny Tiesling <tiesling@gmail.com>
  • Loading branch information
3 people authored Feb 8, 2024
1 parent 7097058 commit b9e5f98
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/flask_muck/commands.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
@with_appcontext
def openapi_spec() -> None:
"""Print OpenAPI spec JSON for this app's API."""
muck = current_app.extensions.get("muck")
if muck is None:
if (muck := current_app.extensions.get("muck")) is None:
print("No Flask-Muck extension initialized in this app")
return
print_json(json.dumps(muck.spec.to_dict(), indent=2))

0 comments on commit b9e5f98

Please sign in to comment.