Replace all occurrences of Python 2 basestring by str. But replace epydoc basestring type hints by typing annotation hints e.g.
def foo(bar): """Sample function. @param bar: a sample Parameter @type bar: basestring """ pass
should become
def foo(bar: str): """Sample function. @param bar: a sample Parameter """ pass
https://codesearch.wmcloud.org/pywikibot/?q=basestring&i=nope&files=&repos=