jenkins-bot has submitted this change. ( https://gerrit.wikimedia.org/r/c/pywikibot/core/+/763470 )
Change subject: [typing] remove name-defined type hint of previous WindowsError ......................................................................
[typing] remove name-defined type hint of previous WindowsError
WindowsError was replaced by OSError which is predefined on all machines. This type hint is no longer required.
Change-Id: I8debe122d158f2f851cd65f616b93073808e36ab --- M pywikibot/config.py 1 file changed, 3 insertions(+), 5 deletions(-)
Approvals: JJMC89: Looks good to me, approved jenkins-bot: Verified
diff --git a/pywikibot/config.py b/pywikibot/config.py index c2f6788..9e3410d 100644 --- a/pywikibot/config.py +++ b/pywikibot/config.py @@ -337,10 +337,8 @@ elif win_version in (6, 10): sub_dir = ['AppData', 'Roaming'] else: - raise OSError( # type: ignore[name-defined] - 'Windows version {} not supported yet.' - .format(win_version) - ) + raise OSError('Windows version {} not supported yet.' + .format(win_version)) base_dir_cand.extend([[home] + sub_dir + ['Pywikibot'], [home] + sub_dir + ['pywikibot']]) else: @@ -918,7 +916,7 @@ # Remove any trailing character, which should be a quote or space # and then remove all whitespace. return cmd[:-1].strip() - except OSError as e: # type: ignore[name-defined] + except OSError as e: # Catch any key lookup errors output('Unable to detect program for file extension "{}": {!r}' .format(extension, e))
pywikibot-commits@lists.wikimedia.org