Skip to content

Commit fedf81f

Browse files
committed
validation: fix nosetest in gyb for Python 3
The file-like object's `write` method in Python 3 returns the number of bytes that are written. This was not previously checked and is not particularly interesting. Simply blackhole the bytes written, repairing the test on Python 3.
1 parent b02924e commit fedf81f

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

utils/gyb.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -763,8 +763,8 @@ def expand(filename, line_directive=_default_line_directive, **local_bindings):
763763
>>> # manually handle closing and deleting this file to allow us to open
764764
>>> # the file by its name across all platforms.
765765
>>> f = NamedTemporaryFile(delete=False)
766-
>>> f.write(
767-
... r'''---
766+
>>> _ = f.write(
767+
... br'''---
768768
... % for i in range(int(x)):
769769
... a pox on ${i} for epoxy
770770
... % end

0 commit comments

Comments
 (0)