for more details.
You should have received a copy of the GNU General Public License
-along with notmuch. If not, see <http://www.gnu.org/licenses/>.
+along with notmuch. If not, see <https://www.gnu.org/licenses/>.
Copyright 2010 Sebastian Spaeth <Sebastian@SSpaeth.de>
Copyright 2012 Justus Winter <4winter@informatik.uni-hamburg.de>
return value
else:
- from configparser import SafeConfigParser
+ from configparser import ConfigParser as SafeConfigParser
+
+ if not hasattr(SafeConfigParser, 'readfp'): # py >= 3.12
+ SafeConfigParser.readfp = SafeConfigParser.read_file
class Python3StringMixIn(object):
def __str__(self):
raise TypeError('Expected str, got %s' % type(value))
return value.encode('utf-8', 'replace')
+
+# We import the SafeConfigParser class on behalf of other code to cope
+# with the differences between Python 2 and 3.
+SafeConfigParser # avoid warning about unused import