升级 Xcode 11 后 Revea

发布时间:2019-10-11 09:02:27编辑:auto阅读(2549)

    报错信息

      File "/Applications/Reveal.app/Contents/SharedSupport/Scripts/RevealServerCommands.py", line 18, in __lldb_init_module
        HandleRevealCommand.__doc__ = CreateRevealCommandOptionsParser().format_help()
      File "/Applications/Reveal.app/Contents/SharedSupport/Scripts/RevealServerCommands.py", line 36, in CreateRevealCommandOptionsParser
        for key, info in subcommands.iteritems():
    AttributeError: 'dict' object has no attribute 'iteritems'
    error: 'reveal' is not a valid command.

    分析

    • 提示问题很明显 python 代码报错
    • Xcode 11 升级了 Python 由 2.7 -> 3
    • 查看 RevealServerCommands.py 定位到底 36 行 代码subcommands.iteritems():
    • iteritems 方法 Python3 废弃了,改为 items()
    • 👌 大功告成,又可以用了。

    其他

    RevealServerCommands.py 位置
    /Applications/Reveal.app/Contents/SharedSupport/Scripts/RevealServerCommands.py

关键字