diff options
| author | Eric Hurst | 2019-08-29 13:28:44 -0600 |
|---|---|---|
| committer | GitHub | 2019-08-29 13:28:44 -0600 |
| commit | 5d27e9a6cabecf357b26216b7afb0880bbaf36ef (patch) | |
| tree | ffb3ea079d713fa8428ceda9477844564b16116a | |
| parent | cec5028f9c85ed567e93cdf84e7f7816fde0d279 (diff) | |
| parent | 1dc6bb3c691bf4698606d5803e6e208d5b1cfddd (diff) | |
| download | eventmq-0.3.10.tar.gz eventmq-0.3.10.zip | |
Merge pull request #70 from RegionSyx/feature/add-missing-dependency0.3.10
Add Python 2/3 Compatibility with configparser
| -rw-r--r-- | eventmq/__init__.py | 2 | ||||
| -rw-r--r-- | eventmq/tests/test_utils.py | 11 | ||||
| -rw-r--r-- | eventmq/utils/settings.py | 9 |
3 files changed, 19 insertions, 3 deletions
diff --git a/eventmq/__init__.py b/eventmq/__init__.py index 018a540..1515f24 100644 --- a/eventmq/__init__.py +++ b/eventmq/__init__.py | |||
| @@ -1,5 +1,5 @@ | |||
| 1 | __author__ = 'EventMQ Contributors' | 1 | __author__ = 'EventMQ Contributors' |
| 2 | __version__ = '0.3.10-rc1' | 2 | __version__ = '0.3.10' |
| 3 | 3 | ||
| 4 | PROTOCOL_VERSION = 'eMQP/1.0' | 4 | PROTOCOL_VERSION = 'eMQP/1.0' |
| 5 | 5 | ||
diff --git a/eventmq/tests/test_utils.py b/eventmq/tests/test_utils.py index 2937085..501b081 100644 --- a/eventmq/tests/test_utils.py +++ b/eventmq/tests/test_utils.py | |||
| @@ -12,7 +12,16 @@ | |||
| 12 | # | 12 | # |
| 13 | # You should have received a copy of the GNU Lesser General Public License | 13 | # You should have received a copy of the GNU Lesser General Public License |
| 14 | # along with eventmq. If not, see <http://www.gnu.org/licenses/>. | 14 | # along with eventmq. If not, see <http://www.gnu.org/licenses/>. |
| 15 | from configparser import ConfigParser | 15 | |
| 16 | # | ||
| 17 | |||
| 18 | # ConfigParser was renamed to configparser in python 3. Do this try...except | ||
| 19 | # to maintain python 2/3 compatability | ||
| 20 | try: | ||
| 21 | from configparser import ConfigParser | ||
| 22 | except ImportError: | ||
| 23 | import ConfigParser | ||
| 24 | |||
| 16 | from imp import reload | 25 | from imp import reload |
| 17 | import io | 26 | import io |
| 18 | import os | 27 | import os |
diff --git a/eventmq/utils/settings.py b/eventmq/utils/settings.py index 7a91858..ade76c2 100644 --- a/eventmq/utils/settings.py +++ b/eventmq/utils/settings.py | |||
| @@ -16,7 +16,14 @@ | |||
| 16 | :mod:`settings` -- Settings Utilities | 16 | :mod:`settings` -- Settings Utilities |
| 17 | ===================================== | 17 | ===================================== |
| 18 | """ | 18 | """ |
| 19 | from configparser import ConfigParser, NoOptionError | 19 | |
| 20 | # ConfigParser was renamed to configparser in python 3. Do this try...except | ||
| 21 | # to maintain python 2/3 compatability | ||
| 22 | try: | ||
| 23 | from configparser import ConfigParser, NoOptionError | ||
| 24 | except ImportError: | ||
| 25 | from ConfigParser import ConfigParser, NoOptionError | ||
| 26 | |||
| 20 | import json | 27 | import json |
| 21 | import logging | 28 | import logging |
| 22 | import os | 29 | import os |