Skip to content

Commit 2cf8350

Browse files
committed
TEMPORARY COMMIT: type check fp.file (pytest-dev#3503) DO NOT MERGE THIS COMMIT
1 parent 48215fd commit 2cf8350

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

_pytest/assertion/rewrite.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -266,6 +266,8 @@ def _write_pyc(state, co, source_stat, pyc):
266266
size = source_stat.size & 0xFFFFFFFF
267267
fp.write(struct.pack("<ll", mtime, size))
268268
if six.PY2:
269+
import types
270+
assert isinstance(fp.file, types.FileType), "unexpected file type: {!r} ({!r})".format(fp.file, type(fp.file))
269271
marshal.dump(co, fp.file)
270272
else:
271273
marshal.dump(co, fp)

0 commit comments

Comments
 (0)