AirtestProject / Poco

A cross-engine test automation framework based on UI inspection
http://airtest.netease.com/
Apache License 2.0
1.78k stars 318 forks source link

python3.10时,import UnityPoco时报错,AttributeError: module 'collections' has no attribute 'MutableMapping' #572

Open bingosam opened 1 year ago

bingosam commented 1 year ago

描述问题bug

python 3.10时,代码引入UnityPoco,运行时即报错 from poco.drivers.unity3d.unity3d_poco import UnityPoco

Traceback (most recent call last):
  File "E:\AirTestProject\air_pro_10\main.py", line 5, in <module>
    from poco.drivers.unity3d.unity3d_poco import UnityPoco
  File "D:\python\lib\site-packages\poco\drivers\unity3d\__init__.py", line 3, in <module>
    from poco.drivers.unity3d.unity3d_poco import UnityPoco
  File "D:\python\lib\site-packages\poco\drivers\unity3d\unity3d_poco.py", line 6, in <module>
    from poco.drivers.std import StdPoco
  File "D:\python\lib\site-packages\poco\drivers\std\__init__.py", line 11, in <module>
    from poco.utils.simplerpc.rpcclient import RpcClient
  File "D:\python\lib\site-packages\poco\utils\simplerpc\rpcclient.py", line 2, in <module>
    from .simplerpc import RpcAgent, RpcConnectionError
  File "D:\python\lib\site-packages\poco\utils\simplerpc\simplerpc.py", line 11, in <module>
    from .jsonrpc import JSONRPCResponseManager, dispatcher
  File "D:\python\lib\site-packages\poco\utils\simplerpc\jsonrpc\__init__.py", line 7, in <module>
    from .dispatcher import Dispatcher
  File "D:\python\lib\site-packages\poco\utils\simplerpc\jsonrpc\dispatcher.py", line 9, in <module>
    class Dispatcher(collections.MutableMapping):
AttributeError: module 'collections' has no attribute 'MutableMapping'

复现步骤 python 3.10 from poco.drivers.unity3d.unity3d_poco import UnityPoco

预期效果 支持python 3.10

python 版本: python 3.10

poco 版本: 1.0.88

其他相关环境信息 python 3.8正常

Evangelistic commented 1 year ago

attached pull request solved this issue: https://github.com/AirtestProject/Poco/pull/598