comparison tests/run-tests.py @ 25438:8c7e938c8146

run-tests: string-escape no longer exists in python 3, use unicode_escape
author Augie Fackler <augie@google.com>
date Mon, 13 Apr 2015 15:57:10 -0400
parents 40b4308d5653
children 6b8ddf896463
comparison
equal deleted inserted replaced
25437:40b4308d5653 25438:8c7e938c8146
1118 def linematch(el, l): 1118 def linematch(el, l):
1119 if el == l: # perfect match (fast) 1119 if el == l: # perfect match (fast)
1120 return True 1120 return True
1121 if el: 1121 if el:
1122 if el.endswith(b" (esc)\n"): 1122 if el.endswith(b" (esc)\n"):
1123 el = el[:-7].decode('string-escape') + '\n'
1124 if sys.version_info[0] == 3: 1123 if sys.version_info[0] == 3:
1125 el.encode('utf-8') 1124 el = el[:-7].decode('unicode_escape') + '\n'
1125 el = el.encode('utf-8')
1126 else:
1127 el = el[:-7].decode('string-escape') + '\n'
1126 if el == l or os.name == 'nt' and el[:-1] + b'\r\n' == l: 1128 if el == l or os.name == 'nt' and el[:-1] + b'\r\n' == l:
1127 return True 1129 return True
1128 if el.endswith(b" (re)\n"): 1130 if el.endswith(b" (re)\n"):
1129 return TTest.rematch(el[:-6], l) 1131 return TTest.rematch(el[:-6], l)
1130 if el.endswith(b" (glob)\n"): 1132 if el.endswith(b" (glob)\n"):