Skip to content

Commit

Permalink
Simplify withas + Administrivia
Browse files Browse the repository at this point in the history
  • Loading branch information
rocky committed Mar 6, 2024
1 parent e40b0ff commit 59a1be5
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 1 deletion.
1 change: 1 addition & 0 deletions admin-tools/check-versions.sh
Original file line number Diff line number Diff line change
Expand Up @@ -27,3 +27,4 @@ for version in $PYVERSIONS; do
fi
echo === $version ===
done
finish
1 change: 1 addition & 0 deletions admin-tools/make-dist.sh
Original file line number Diff line number Diff line change
Expand Up @@ -29,3 +29,4 @@ for pyversion in $PYVERSIONS; do
done

python ./setup.py bdist_wheel sdist
finish
5 changes: 5 additions & 0 deletions decompyle3/semantics/consts.py
Original file line number Diff line number Diff line change
Expand Up @@ -577,6 +577,11 @@
"importlist": ("%C", (0, maxint, ", ")),
"import_from": ("%|from %[2]{pattr} import %c\n", (3, "importlist")),
"import_from_star": ("%|from %[2]{pattr} import *\n",),

# If there are situations where we need "with ... as ()"
# We may need to customize this in n_withasstmt
"withasstmt": ("%|with %c as %c:\n%+%c%-", 0, 2, 3),

}
# fmt: on

Expand Down
1 change: 0 additions & 1 deletion decompyle3/semantics/customize3.py
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,6 @@ def customize_for_version3(self, version):
"tf_tryelsestmtc3": ("%c%-%c%|else:\n%+%c", 1, 3, 5),
"store_locals": ("%|# inspect.currentframe().f_locals = __locals__\n",),
"with": ("%|with %c:\n%+%c%-", 0, 3),
"withasstmt": ("%|with %c as %c:\n%+%c%-", 0, 2, 3),
}
)

Expand Down

0 comments on commit 59a1be5

Please sign in to comment.