Skip to content

Commit

Permalink
Note xdis now has FSTRING_CONVERSOIN_MAP
Browse files Browse the repository at this point in the history
  • Loading branch information
rocky committed Jul 13, 2024
1 parent 54cae9b commit cf3f7c3
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions decompyle3/semantics/customize37.py
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@ def escape_format(s):
"dict", [Token("BUILD_MAP_0", attr=0, pattr="", offset=0, has_arg=True)]
)

# FIXME: Get this from a newer xdis!
FSTRING_CONVERSION_MAP = {1: "!s", 2: "!r", 3: "!a", "X": ":X"}

#######################
Expand Down Expand Up @@ -1190,7 +1191,7 @@ def n_call_ex_kw(node):
if value == "":
fmt = "%c(%p)"
else:
fmt = "%c" + ("(%s, " % value).replace('%', '%%') + "%p)"
fmt = "%c" + ("(%s, " % value).replace("%", "%%") + "%p)"

self.template_engine(
(fmt, (0, "expr"), (2, "build_map_unpack_with_call", 100)), node
Expand All @@ -1209,7 +1210,7 @@ def n_call_ex_kw2(node):
if value == "":
fmt = "%c(%p)"
else:
fmt = "%c" + ("(%s, " % value).replace('%', '%%') + "%p)"
fmt = "%c" + ("(%s, " % value).replace("%", "%%") + "%p)"

self.template_engine(
(fmt, (0, "expr"), (2, "build_map_unpack_with_call", 100)), node
Expand Down

0 comments on commit cf3f7c3

Please sign in to comment.