openatx / adbutils

pure python adb library for google adb service.
MIT License
780 stars 180 forks source link

AttributeError: module 're' has no attribute 'Pattern' #82

Closed ufo105 closed 1 year ago

ufo105 commented 1 year ago

平台:ubuntu 18.04 python:python3.6.9 导入adbutils库报错如下:

>>> import adbutils
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/home/realeasy/.local/lib/python3.6/site-packages/adbutils/__init__.py", line 14, in <module>
    from ._device import AdbDevice, Sync
  File "/home/realeasy/.local/lib/python3.6/site-packages/adbutils/_device.py", line 49, in <module>
    class BaseDevice:
  File "/home/realeasy/.local/lib/python3.6/site-packages/adbutils/_device.py", line 352, in BaseDevice
    command: str = "logcat -v time") -> StopEvent:
AttributeError: module 're' has no attribute 'Pattern'
PythonTryHard commented 1 year ago

@ufo105 Your Python is too old. re.Pattern was introduced in Python 3.7. @codeskyblue Any way to mark this package to be minimum Python 3.7?

codeskyblue commented 1 year ago

@PythonTryHard thanks, limited python version in setup.py with adbutils version 1.2.2

exzhawk commented 1 year ago

@codeskyblue and now whoever installs this package with Python 3.6 will get version 1.2.1 and it won't work this line should be changed https://github.com/openatx/adbutils/blob/5787ac36c99ebfd7100e70a093da2fa30f5a1378/README.md?plain=1#L4 And providing the latest version number that supports python3.6 is appreciated. ( 1.0.10 I guess? )

codeskyblue commented 1 year ago

@exzhawk I add a new version 1.2.10 for python 3.6, check if this version works

codeskyblue commented 1 year ago

1.2.10 was removed, use 1.2.11, which only limit to python3.6