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 00000000..795b6ca8 Binary files /dev/null and b/test/bytecode_2.4/02_except_as.pyc differ 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