X-Git-Url: https://git.notmuchmail.org/git?a=blobdiff_plain;f=bindings%2Fpython%2Fnotmuch%2Fdatabase.py;h=ee0366cd0c846ce848be42c1a349e38be68d7b81;hb=892bb1ee6d52556eaf88cc35b61048a4de862352;hp=fb4c92931a36eaf7d19cd13143ea9409fc5a4776;hpb=05c3e83bd272635ecc5e86d767250de1eb680a09;p=notmuch diff --git a/bindings/python/notmuch/database.py b/bindings/python/notmuch/database.py index fb4c9293..ee0366cd 100644 --- a/bindings/python/notmuch/database.py +++ b/bindings/python/notmuch/database.py @@ -20,6 +20,7 @@ Copyright 2010 Sebastian Spaeth import os import codecs from ctypes import c_char_p, c_void_p, c_uint, byref, POINTER +from .compat import SafeConfigParser from .globals import ( nmlib, Enum, @@ -558,7 +559,7 @@ class Database(object): """ self._assert_db_is_initialized() tags_p = Database._get_all_tags(self._db) - if tags_p == None: + if not tags_p: raise NullPointerError() return Tags(tags_p, self) @@ -589,13 +590,6 @@ class Database(object): """ Reads a user's notmuch config and returns his db location Throws a NotmuchError if it cannot find it""" - 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')) @@ -609,7 +603,9 @@ class Database(object): def db_p(self): """Property returning a pointer to `notmuch_database_t` or `None` - This should normally not be needed by a user (and is not yet - guaranteed to remain stable in future versions). + .. deprecated:: 0.14 + If you really need a pointer to the notmuch + database object use the `_pointer` field. This + alias will be removed in notmuch 0.15. """ return self._db