在它說,「源」可以是STR或AST對象IronPython的編譯()不接受AST對象
當試圖編譯我的AST根文檔:
dl = compile(newRoot, '<string>', 'eval')
我得到這個例外:
expected str, got Module
我正在使用IronPython的最新版本。
有沒有想法爲什麼這不起作用?我發現的所有例子似乎都是這樣做的,沒有任何問題。
是否有解決方法來編譯AST對象?
謝謝!
PD:我發現了這個問題,但似乎也沒有什麼活動:http://ironpython.codeplex.com/workitem/32526
a'Module'是一個AST對象嗎? – 2012-06-05 00:41:00
是的,Module是一類ast節點。 – user1275011
這是IronPython中的一個bug。我不得不貶低AST,將其轉換爲字符串,然後將其提供給compile()。 :( – user1275011