2014-04-09 37 views

回答

0

要在猴補丁,你就需要將相關功能分配給bytes.format。嘗試它與虛擬功能是否這樣做:

>>> bytes.format = lambda *s: None 
Traceback (most recent call last): 
    File "<stdin>", line 1, in <module> 
TypeError: can't set attributes of built-in/extension type 'bytes' 

所以,不,你不能這樣做。您需要修改創建類bytes的C代碼 - 此時,您可能只需應用相關錯誤中的補丁。