jenkins-bot submitted this change.

View Change

Approvals: Xqt: Looks good to me, approved jenkins-bot: Verified
[fix] Keep pwb.py and setup.py Python 2 compatible

Also add syntax check

Change-Id: Iaf77759dface23a0e5061e185e615fd66b6e0342
---
M pwb.py
M setup.py
2 files changed, 4 insertions(+), 6 deletions(-)

diff --git a/pwb.py b/pwb.py
index e7a35af..730bad8 100755
--- a/pwb.py
+++ b/pwb.py
@@ -52,10 +52,8 @@

try:
from pathlib import Path
-except ImportError as e:
- from setup import PYTHON_VERSION, VERSIONS_REQUIRED_MESSAGE
- print(VERSIONS_REQUIRED_MESSAGE.format(version=PYTHON_VERSION))
- sys.exit(e)
+except ImportError:
+ pass

pwb = None
site_package = False
diff --git a/setup.py b/setup.py
index 6202b51..d5f3fcf 100755
--- a/setup.py
+++ b/setup.py
@@ -216,11 +216,11 @@
include = os.path.relpath(line.rsplit('::')[1].strip())
if os.path.exists(include):
with open(include) as g:
- desc.append(re.sub(*pattern, g.read()))
+ desc.append(re.sub(pattern[0], pattern[1], g.read()))
else:
print('Cannot include {}; file not found'.format(include))
else:
- desc.append(re.sub(*pattern, line))
+ desc.append(re.sub(pattern[0], pattern[1], line))
return ''.join(desc)



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

Gerrit-Project: pywikibot/core
Gerrit-Branch: master
Gerrit-Change-Id: Iaf77759dface23a0e5061e185e615fd66b6e0342
Gerrit-Change-Number: 803292
Gerrit-PatchSet: 12
Gerrit-Owner: Xqt <info@gno.de>
Gerrit-Reviewer: Xqt <info@gno.de>
Gerrit-Reviewer: jenkins-bot
Gerrit-MessageType: merged