juhasch / pyBusPirateLite

Python library for BusPirate
https://pybuspiratelite.readthedocs.io/en/latest/
Other
59 stars 32 forks source link

pyBusPirateLite/I2C.py: use raw string for sniffer #34

Open julianvilas opened 5 months ago

julianvilas commented 5 months ago

The I2C.sniffer function documentation raises a SyntaxWarning in more recent python versions (3.12 in this case), complaining about an invalid escape sequence '\ '.

This commit makes the string to be interpreted as raw instead.

Before:

$ python
Python 3.12.2 (main, Feb  6 2024, 20:19:44) [Clang 15.0.0 (clang-1500.1.0.2.5)] on darwin
Type "help", "copyright", "credits" or "license" for more information.
>>> from pyBusPirateLite import I2C
.../pyBusPirateLite/pyBusPirateLite/I2C.py:160: SyntaxWarning: invalid escape sequence '\ '
  """ Sniff traffic on an I2C bus.

After:

$ python
Python 3.12.2 (main, Feb  6 2024, 20:19:44) [Clang 15.0.0 (clang-1500.1.0.2.5)] on darwin
Type "help", "copyright", "credits" or "license" for more information.
>>> from pyBusPirateLite import I2C