0

我做了一个小文件test.py

from pathlib import Path
home = Path.home()
print(home)

编译

py -m transcrypt -b -n .\test.py

并得到错误,

Error while compiling (offending file last):   
        File './test.py', line 1, at import of:
        File 'pathlib', line 724, namely:      
        Can't import from module 'pathlib' 

pathlib.py第 724 行的内容,

...
724    drive = property(attrgetter('_drv'),
725                     doc="""The drive prefix (letter or UNC path), if any.""")
...

文档说 Transcrypt 支持装饰器,我假设它理解装饰器功能。我不确定为什么会发生这种情况,任何线索将不胜感激。

4

0 回答 0