Fix Python 3.x try/else detection

Fixes #155
This commit is contained in:
rocky
2019-01-01 22:50:28 -05:00
parent acd0e5fea6
commit a2321773d7
7 changed files with 77 additions and 25 deletions

View File

@@ -1,4 +1,4 @@
# Copyright (c) 2018 by Rocky Bernstein
# Copyright (c) 2018-2019 by Rocky Bernstein
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
@@ -263,6 +263,12 @@ def customize_for_version3(self, version):
self.prune() # stop recursing
self.n_mkfunc_annotate = n_mkfunc_annotate
TABLE_DIRECT.update({
'tryelsestmtl3': ( '%|try:\n%+%c%-%c%|else:\n%+%c%-',
(1, 'suite_stmts_opt'),
(3, 'except_handler'),
(5, 'else_suitel') ),
})
if version >= 3.4:
########################
# Python 3.4+ Additions