diff --git a/src/api.py b/src/api.py index 9c0c18a7..c66c4a72 100644 --- a/src/api.py +++ b/src/api.py @@ -58,7 +58,11 @@ For further examples please reference `.tests.test_api`. """ import base64 -import ConfigParser +try: + import ConfigParser +except ModuleNotFoundError: + import configparser as ConfigParser + ConfigParser.SafeConfigParser = ConfigParser.ConfigParser import errno import hashlib import httplib diff --git a/src/bitmessagecurses/__init__.py b/src/bitmessagecurses/__init__.py index 7c2ed733..3cbb3eaa 100644 --- a/src/bitmessagecurses/__init__.py +++ b/src/bitmessagecurses/__init__.py @@ -10,7 +10,11 @@ Bitmessage commandline interface # * python2-pythondialog # * dialog -import ConfigParser +try: + import ConfigParser +except ModuleNotFoundError: + import configparser as ConfigParser + ConfigParser.SafeConfigParser = ConfigParser.ConfigParser import curses import os import sys diff --git a/src/bmconfigparser.py b/src/bmconfigparser.py index ff43fd7c..06305f20 100644 --- a/src/bmconfigparser.py +++ b/src/bmconfigparser.py @@ -2,7 +2,11 @@ BMConfigParser class definition and default configuration settings """ -import ConfigParser +try: + import ConfigParser +except ModuleNotFoundError: + import configparser as ConfigParser + ConfigParser.SafeConfigParser = ConfigParser.ConfigParser import os import shutil from datetime import datetime diff --git a/src/debug.py b/src/debug.py index cab07275..0e3eb42c 100644 --- a/src/debug.py +++ b/src/debug.py @@ -35,7 +35,11 @@ Logging is thread-safe so you don't have to worry about locks, just import and log. """ -import ConfigParser +try: + import ConfigParser +except ModuleNotFoundError: + import configparser as ConfigParser + ConfigParser.SafeConfigParser = ConfigParser.ConfigParser import logging import logging.config import os