That is, an object whose type defines the protocol slot. Note that due to protocol confusion, a variant of the original crasher that returned e.g., a machine.Pin instance could still lead to a crash. (#17852) Closes: #17841 Signed-off-by: Jeff Epler <jepler@gmail.com>
19 lines
328 B
Python
19 lines
328 B
Python
import os
|
|
import vfs
|
|
|
|
|
|
class Filesystem:
|
|
def mount(self, readonly, mkfs):
|
|
pass
|
|
|
|
def open(self, file, mode):
|
|
return None # violates vfs contract
|
|
|
|
|
|
fs = Filesystem()
|
|
vfs.mount(fs, "/test_mnt")
|
|
try:
|
|
execfile("/test_mnt/test.py")
|
|
print("ExecFile succeeded")
|
|
except TypeError:
|
|
print("TypeError")
|