Skip to content

Commit 799cd52

Browse files
committed
Restore legacy Python compatibility
1 parent 544934a commit 799cd52

File tree

3 files changed

+20
-4
lines changed

3 files changed

+20
-4
lines changed

CHANGELOG.md

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,12 @@
1+
# 2.0.1 (2019-10-13)
2+
3+
- Restore compatibility layer to unofficially support legacy Python.
4+
15
# 2.0 (2019-10-13)
26

37
- Deprecated `versions` in favor of `version` option.
48
- Deprecated `|` in favor of `||` for checking multiple versions.
5-
- Dropped support for Python 2, Python 3.4, and Python 3.5
9+
- Stopped testing against Python 2, Python 3.4, and Python 3.5.
610

711
# 1.6.3 (2019-10-12)
812

pyproject.toml

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
[tool.poetry]
22

33
name = "verchew"
4-
version = "2.0" # also update verchew/script.py
4+
version = "2.0.1" # also update verchew/script.py
55
description = "System dependency version checker."
66

77
license = "MIT"
@@ -25,8 +25,13 @@ classifiers = [
2525
"Intended Audience :: Developers",
2626
"Natural Language :: English",
2727
"Operating System :: OS Independent",
28+
"Programming Language :: Python :: 2.7",
29+
"Programming Language :: Python :: 3.3",
30+
"Programming Language :: Python :: 3.4",
31+
"Programming Language :: Python :: 3.5",
2832
"Programming Language :: Python :: 3.6",
2933
"Programming Language :: Python :: 3.7",
34+
"Programming Language :: Python :: 3.8",
3035
"Topic :: Software Development",
3136
"Topic :: Software Development :: Build Tools",
3237
"Topic :: Software Development :: Testing",

verchew/script.py

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,6 @@
3030
from __future__ import unicode_literals
3131

3232
import argparse
33-
import configparser
3433
import logging
3534
import os
3635
import re
@@ -41,8 +40,14 @@
4140
from typing import Any, Dict
4241

4342

44-
__version__ = '2.0'
43+
PY2 = sys.version_info[0] == 2
4544

45+
if PY2:
46+
import ConfigParser as configparser
47+
else:
48+
import configparser # type: ignore
49+
50+
__version__ = '2.0.1'
4651

4752
CONFIG_FILENAMES = ['verchew.ini', '.verchew.ini', '.verchewrc', '.verchew']
4853

@@ -298,6 +303,8 @@ def show(text, start='', end='\n', head=False):
298303
log.info(text)
299304
else:
300305
formatted = start + text + end
306+
if PY2:
307+
formatted = formatted.encode('utf-8')
301308
sys.stdout.write(formatted)
302309
sys.stdout.flush()
303310

0 commit comments

Comments
 (0)