我正在使用IronPython 2.6.10920.0 on .NET 4.0.30319.1
作为Linux下HFSS现场仿真软件的一部分。我对json
模块有一个奇怪的问题:
>>>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
他想用这个告诉我什么?