From f425db33b753e891058ff97faed1447b48e75276 Mon Sep 17 00:00:00 2001 From: rocky Date: Wed, 3 Jul 2019 19:16:09 -0400 Subject: [PATCH] except_cond3 needs to be in 2.x --- test/bytecode_2.4/02_except_as.pyc | Bin 0 -> 309 bytes uncompyle6/semantics/customize.py | 6 ++++++ uncompyle6/semantics/customize25.py | 2 -- 3 files changed, 6 insertions(+), 2 deletions(-) create mode 100644 test/bytecode_2.4/02_except_as.pyc diff --git a/test/bytecode_2.4/02_except_as.pyc b/test/bytecode_2.4/02_except_as.pyc new file mode 100644 index 0000000000000000000000000000000000000000..795b6ca80b252308de9dccb3a1b8097e4cfe76e5 GIT binary patch literal 309 zcmYL?zfQw25XQfYU5YG_x)h0}16?vv)PWTi7LXXi05V8XnjWaAiKE0pWG#=$Tkr%u z8zd~^t3@2a0;bMig6CH~$>^0h?wEEo*dfCV1wTWBV{8@L&WUKDHsE7TxPzzVFf zQ>f2Cnn!VPDuebw`V?Hg2s=WZfS%Tbhcpp?uLQ5o-KXR53%5UtZO{HlRMyviQ}IpP zy4I5vipW)D=?|rH$HRY{)3Bcf%PcA#R4~rMb}I1;KNr<)s%Fc1=lZtf#j1Z>UM?<{ bIe(Vi_`K-On;{;$nucK`P-OI}n$U#yya+Sa literal 0 HcmV?d00001 diff --git a/uncompyle6/semantics/customize.py b/uncompyle6/semantics/customize.py index 5c18d325..beb8f616 100644 --- a/uncompyle6/semantics/customize.py +++ b/uncompyle6/semantics/customize.py @@ -57,6 +57,12 @@ def customize_for_version(self, is_pypy, version): from uncompyle6.semantics.customize3 import customize_for_version3 customize_for_version3(self, version) else: # < 3.0 + TABLE_DIRECT.update({ + 'except_cond2' : ( '%|except %c as %c:\n', + (1, 'expr'), (5, 'store') ), + 'except_cond3' : ( '%|except %c, %c:\n', + (1, 'expr'), (-2, 'store') ) + }) if 2.4 <= version <= 2.6: TABLE_DIRECT.update({ 'comp_for': ( ' for %c in %c', 3, 1 ), diff --git a/uncompyle6/semantics/customize25.py b/uncompyle6/semantics/customize25.py index 88b6fa50..5b1be0ce 100644 --- a/uncompyle6/semantics/customize25.py +++ b/uncompyle6/semantics/customize25.py @@ -26,8 +26,6 @@ def customize_for_version25(self, version): # Import style for 2.5+ ######################## TABLE_DIRECT.update({ - 'except_cond3' : ( '%|except %c, %c:\n', - (1, 'expr'), (-2, 'store') ), 'importmultiple': ( '%|import %c%c\n', 2, 3 ), 'import_cont' : ( ', %c', 2 ), # With/as is allowed as "from future" thing in 2.5