2014-09-03 23 views
1

我使用IronPython 2.6.10920.0 on .NET 4.0.30319.1作爲linux下的HFSS現場仿真軟件的一部分。而且我有一個奇怪的問題與json模塊:json.loads中的MissingMemberException()

>>>import json 
>>>print json.dumps('foo') 
'"foo"' 
>>>print json.loads('"foo"') 
MissingMemberException: 'NoneType' object has no attribute 'scanner' 

可能是什麼原因?我怎樣才能使它工作?

UPD:當我包裹上面的代碼爲try: .. except .., e: print e,我得到這樣的輸出:

System.MissingMemberException: 'NoneType' object has no attribute 'scanner' 
    at (wrapper dynamic-method) object:CallSite.Target (System.Runtime.CompilerServices.Closure,System.Runtime.CompilerServices.CallSite,object,IronPython.Runtime.CodeContext) 
    at Microsoft.Scripting.Interpreter.DynamicInstruction`3[System.Object,IronPython.Runtime.CodeContext,System.Object].Run (Microsoft.Scripting.Interpreter.InterpretedFrame frame) [0x00000] in <filename unknown>:0 
    at Microsoft.Scripting.Interpreter.Interpreter.RunInstructions (Microsoft.Scripting.Interpreter.InterpretedFrame frame) [0x00000] in <filename unknown>:0 
    at Microsoft.Scripting.Interpreter.Interpreter.Run (Microsoft.Scripting.Interpreter.InterpretedFrame frame) [0x00000] in <filename unknown>:0 

是什麼,他要告訴我這個?

回答

1

我不知道json模塊是否在2.6中工作。如果可以的話,試試upgrading to 2.7,json的工作。

相關問題