Skip to content

Commit 9b6bb1d

Browse files
committed
Fix issue2550994: breakage caused by configparser backports.
1 parent 85efac0 commit 9b6bb1d

File tree

2 files changed

+19
-3
lines changed

2 files changed

+19
-3
lines changed

CHANGES.txt

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,17 @@ Python v2.5 and v2.6. Starting with the v1.6 releases of Roundup
1111
v2.7.2 is required to run newer releases of Roundup.
1212

1313

14+
2019-??-?? 1.6.1
15+
16+
Features:
17+
- doc updates. Link rot fixed and some grammar changes. (John Rouillard)
18+
19+
Fixed:
20+
21+
- issue2550994: avoid breakage caused by use of backports of Python 3
22+
configparser module to Python 2. (Joseph Myers)
23+
24+
1425
2018-07-13 1.6.0
1526

1627
Features:

roundup/configuration.py

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,17 +2,22 @@
22
#
33
__docformat__ = "restructuredtext"
44

5-
try:
5+
# Some systems have a backport of the Python 3 configparser module to
6+
# Python 2: <https://pypi.org/project/configparser/>. That breaks
7+
# Roundup if used with Python 2 because it generates unicode objects
8+
# where not expected by the Python code. Thus, a version check is
9+
# used here instead of try/except.
10+
import sys
11+
if sys.version_info[0] > 2:
612
import configparser # Python 3
7-
except ImportError:
13+
else:
814
import ConfigParser as configparser # Python 2
915

1016
import getopt
1117
import imp
1218
import logging, logging.config
1319
import os
1420
import re
15-
import sys
1621
import time
1722
import smtplib
1823

0 commit comments

Comments
 (0)