jenkins-bot submitted this change.

View Change

Approvals: JJMC89: Looks good to me, approved jenkins-bot: Verified
[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(-)

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))

To view, visit change 763470. To unsubscribe, or for help writing mail filters, visit settings.

Gerrit-Project: pywikibot/core
Gerrit-Branch: master
Gerrit-Change-Id: I8debe122d158f2f851cd65f616b93073808e36ab
Gerrit-Change-Number: 763470
Gerrit-PatchSet: 1
Gerrit-Owner: Xqt <info@gno.de>
Gerrit-Reviewer: JJMC89 <JJMC89.Wikimedia@gmail.com>
Gerrit-Reviewer: jenkins-bot
Gerrit-MessageType: merged