comparison tests/test-ui-config.py @ 25660:328739ea70c3

global: mass rewrite to use modern exception syntax Python 2.6 introduced the "except type as instance" syntax, replacing the "except type, instance" syntax that came before. Python 3 dropped support for the latter syntax. Since we no longer support Python 2.4 or 2.5, we have no need to continue supporting the "except type, instance". This patch mass rewrites the exception syntax to be Python 2.6+ and Python 3 compatible. This patch was produced by running `2to3 -f except -w -n .`.
author Gregory Szorc <gregory.szorc@gmail.com>
date Tue, 23 Jun 2015 22:20:08 -0700
parents fa2b596db182
children ae606bdedc3e
comparison
equal deleted inserted replaced
25659:d60678a567a9 25660:328739ea70c3
37 print repr(testui.config('values', 'bool2')) 37 print repr(testui.config('values', 'bool2'))
38 print repr(testui.config('values', 'unknown')) 38 print repr(testui.config('values', 'unknown'))
39 print "---" 39 print "---"
40 try: 40 try:
41 print repr(testui.configbool('values', 'string')) 41 print repr(testui.configbool('values', 'string'))
42 except error.ConfigError, inst: 42 except error.ConfigError as inst:
43 print inst 43 print inst
44 print repr(testui.configbool('values', 'bool1')) 44 print repr(testui.configbool('values', 'bool1'))
45 print repr(testui.configbool('values', 'bool2')) 45 print repr(testui.configbool('values', 'bool2'))
46 print repr(testui.configbool('values', 'bool2', True)) 46 print repr(testui.configbool('values', 'bool2', True))
47 print repr(testui.configbool('values', 'unknown')) 47 print repr(testui.configbool('values', 'unknown'))