]> git.notmuchmail.org Git - notmuch/commitdiff
python: cleanup imports
authorJustus Winter <4winter@informatik.uni-hamburg.de>
Fri, 8 Jan 2016 12:56:10 +0000 (13:56 +0100)
committerJustus Winter <4winter@informatik.uni-hamburg.de>
Fri, 8 Jan 2016 12:58:33 +0000 (13:58 +0100)
Drop unused imports, and avoid warning about unused imports when we
import something on behalf of another module.

Signed-off-by: Justus Winter <4winter@informatik.uni-hamburg.de>
bindings/python/notmuch/compat.py
bindings/python/notmuch/database.py
bindings/python/notmuch/filenames.py
bindings/python/notmuch/globals.py

index adc8d244e4f251a5c5d3edd4cae78d7a80dc695b..daa268c12cfb2de49a796d2f70c074498c220ff8 100644 (file)
@@ -65,3 +65,7 @@ else:
             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
index f7d04bf4a5690941ab9367eaa1f6925f70b48483..93e7b7a1cb64d8ffa7aa8607bb679546d995ed2d 100644 (file)
@@ -36,7 +36,6 @@ from .errors import (
     NotmuchError,
     NullPointerError,
     NotInitializedError,
-    ReadOnlyDatabaseError,
 )
 from .message import Message
 from .tag import Tags
index 9e5d1a30f744749e8aa0bf1ba8dba4c6aae824cb..f8f383e4fd5370d2ad3b801ec36ae4ae427ee6c1 100644 (file)
@@ -19,7 +19,6 @@ Copyright 2010 Sebastian Spaeth <Sebastian@SSpaeth.de>
 from ctypes import c_char_p
 from .globals import (
     nmlib,
-    NotmuchMessageP,
     NotmuchFilenamesP,
     Python3StringMixIn,
 )
index 70cfdc3d12f5d3d7b6e6a84208ec7c133926afa3..6872a2916a72b1fffa6c9df72c633440f48e2e57 100644 (file)
@@ -33,6 +33,11 @@ except:
 
 from .compat import Python3StringMixIn, encode_utf8 as _str
 
+# We import these on behalf of other modules.  Silence warning about
+# these symbols not being used.
+Python3StringMixIn
+_str
+
 class Enum(object):
     """Provides ENUMS as "code=Enum(['a','b','c'])" where code.a=0 etc..."""
     def __init__(self, names):