Skip to content

Commit 3119096

Browse files
committed
Fix issue2550994: breakage caused by configparser backports.
1 parent fcb896c commit 3119096

File tree

2 files changed

+10
-3
lines changed

2 files changed

+10
-3
lines changed

CHANGES.txt

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,8 @@ Fixed:
3939
- issue2550993: fixed edit CSV action to update restored items to the
4040
new value instead of restoring with the previous value (Christof
4141
Meerwald)
42+
- issue2550994: avoid breakage caused by use of backports of Python 3
43+
configparser module to Python 2. (Joseph Myers)
4244

4345

4446
2018-07-13 1.6.0

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)