Skip to content

Commit 29e1951

Browse files
committed
patch 7.4.1456
Problem: Test 87 fails with Python 3.5. Solution: Work around difference. (Taro Muraoka)
1 parent fc2457e commit 29e1951

File tree

2 files changed

+9
-1
lines changed

2 files changed

+9
-1
lines changed

src/testdir/test87.in

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -228,6 +228,8 @@ def ee(expr, g=globals(), l=locals()):
228228
cb.append(expr + ':' + repr((e.__class__, TypeError(msg))))
229229
else:
230230
cb.append(expr + ':' + repr((e.__class__, e)))
231+
elif sys.version_info >= (3, 5) and e.__class__ is ValueError and str(e) == 'embedded null byte':
232+
msg = cb.append(expr + ':' + repr((TypeError, TypeError('expected bytes with no null'))))
231233
else:
232234
cb.append(expr + ':' + repr((e.__class__, e)))
233235
else:
@@ -264,13 +266,17 @@ EOF
264266
:let messages=[]
265267
:delfunction DictNew
266268
py3 <<EOF
269+
import sys
267270
d=vim.bindeval('{}')
268271
m=vim.bindeval('messages')
269272
def em(expr, g=globals(), l=locals()):
270273
try:
271274
exec(expr, g, l)
272275
except Exception as e:
273-
m.extend([e.__class__.__name__])
276+
if sys.version_info >= (3, 5) and e.__class__ is ValueError and str(e) == 'embedded null byte':
277+
m.extend([TypeError.__name__])
278+
else:
279+
m.extend([e.__class__.__name__])
274280

275281
em('d["abc1"]')
276282
em('d["abc1"]="\\0"')

src/version.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -743,6 +743,8 @@ static char *(features[]) =
743743

744744
static int included_patches[] =
745745
{ /* Add new patch number below this line */
746+
/**/
747+
1456,
746748
/**/
747749
1455,
748750
/**/

0 commit comments

Comments
 (0)