mirror of
https://git.notmuchmail.org/git/notmuch
synced 2024-12-22 17:34:54 +01:00
py3k: The ConfigParser module has been renamed to configparser
This commit is contained in:
parent
676ce952d3
commit
4ed0362d41
2 changed files with 13 additions and 2 deletions
|
@ -17,7 +17,12 @@ import stat
|
|||
import email
|
||||
|
||||
from notmuch import Database, Query, NotmuchError, STATUS
|
||||
from ConfigParser import SafeConfigParser
|
||||
try:
|
||||
# python3.x
|
||||
from configparser import SafeConfigParser
|
||||
except ImportError:
|
||||
# python2.x
|
||||
from ConfigParser import SafeConfigParser
|
||||
from cStringIO import StringIO
|
||||
|
||||
PREFIX = re.compile('(\w+):(.*$)')
|
||||
|
|
|
@ -543,7 +543,13 @@ class Database(object):
|
|||
""" Reads a user's notmuch config and returns his db location
|
||||
|
||||
Throws a NotmuchError if it cannot find it"""
|
||||
from ConfigParser import SafeConfigParser
|
||||
try:
|
||||
# python3.x
|
||||
from configparser import SafeConfigParser
|
||||
except ImportError:
|
||||
# python2.x
|
||||
from ConfigParser import SafeConfigParser
|
||||
|
||||
config = SafeConfigParser()
|
||||
conf_f = os.getenv('NOTMUCH_CONFIG',
|
||||
os.path.expanduser('~/.notmuch-config'))
|
||||
|
|
Loading…
Reference in a new issue