Replace array.tostring() with array.tobytes()

Proprietary

Replace tostring() with tobytes() on array objects. The tostring() method was deprecated in Python 3.2 and removed in 3.9. Only fires where the receiver's type resolves to array.array or a subclass.

org.openrewrite.python.migrate.ReplaceArrayTostring
mod run . --recipe=org.openrewrite.python.migrate.ReplaceArrayTostring

Install it once, then run it on every repository under the current directory. New to the Moderne CLI? Set it up.