2014-09-03 56 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的工作。

相关问题