Mercurial > p > roundup > code
comparison roundup/configuration.py @ 5517:0cdf19b82354
Fix issue2550994: breakage caused by configparser backports.
| author | Joseph Myers <jsm@polyomino.org.uk> |
|---|---|
| date | Mon, 20 Aug 2018 00:50:16 +0000 |
| parents | b7fa56ced601 |
| children | 79da1ca2f94b |
comparison
equal
deleted
inserted
replaced
| 5516:91391a366d92 | 5517:0cdf19b82354 |
|---|---|
| 1 # Roundup Issue Tracker configuration support | 1 # Roundup Issue Tracker configuration support |
| 2 # | 2 # |
| 3 __docformat__ = "restructuredtext" | 3 __docformat__ = "restructuredtext" |
| 4 | 4 |
| 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: | |
| 6 import configparser # Python 3 | 12 import configparser # Python 3 |
| 7 except ImportError: | 13 else: |
| 8 import ConfigParser as configparser # Python 2 | 14 import ConfigParser as configparser # Python 2 |
| 9 | 15 |
| 10 import getopt | 16 import getopt |
| 11 import imp | 17 import imp |
| 12 import logging, logging.config | 18 import logging, logging.config |
| 13 import os | 19 import os |
| 14 import re | 20 import re |
| 15 import sys | |
| 16 import time | 21 import time |
| 17 import smtplib | 22 import smtplib |
| 18 | 23 |
| 19 import roundup.date | 24 import roundup.date |
| 20 | 25 |
