aboutsummaryrefslogtreecommitdiff
path: root/bindings/python
diff options
context:
space:
mode:
authorJustus Winter <4winter@informatik.uni-hamburg.de>2016-01-08 13:56:10 +0100
committerJustus Winter <4winter@informatik.uni-hamburg.de>2016-01-08 13:58:33 +0100
commita5c1536d9a631f15c74602ef12a0867d278a7af0 (patch)
treef373291c76a6b1f4640218c08062e354d4dd6826 /bindings/python
parent096c600b96e5d556b67ac01263a1364d0b8e9115 (diff)
python: cleanup imports
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>
Diffstat (limited to 'bindings/python')
-rw-r--r--bindings/python/notmuch/compat.py4
-rw-r--r--bindings/python/notmuch/database.py1
-rw-r--r--bindings/python/notmuch/filenames.py1
-rw-r--r--bindings/python/notmuch/globals.py5
4 files changed, 9 insertions, 2 deletions
diff --git a/bindings/python/notmuch/compat.py b/bindings/python/notmuch/compat.py
index adc8d244..daa268c1 100644
--- a/bindings/python/notmuch/compat.py
+++ b/bindings/python/notmuch/compat.py
@@ -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
diff --git a/bindings/python/notmuch/database.py b/bindings/python/notmuch/database.py
index f7d04bf4..93e7b7a1 100644
--- a/bindings/python/notmuch/database.py
+++ b/bindings/python/notmuch/database.py
@@ -36,7 +36,6 @@ from .errors import (
NotmuchError,
NullPointerError,
NotInitializedError,
- ReadOnlyDatabaseError,
)
from .message import Message
from .tag import Tags
diff --git a/bindings/python/notmuch/filenames.py b/bindings/python/notmuch/filenames.py
index 9e5d1a30..f8f383e4 100644
--- a/bindings/python/notmuch/filenames.py
+++ b/bindings/python/notmuch/filenames.py
@@ -19,7 +19,6 @@ Copyright 2010 Sebastian Spaeth <Sebastian@SSpaeth.de>
from ctypes import c_char_p
from .globals import (
nmlib,
- NotmuchMessageP,
NotmuchFilenamesP,
Python3StringMixIn,
)
diff --git a/bindings/python/notmuch/globals.py b/bindings/python/notmuch/globals.py
index 70cfdc3d..6872a291 100644
--- a/bindings/python/notmuch/globals.py
+++ b/bindings/python/notmuch/globals.py
@@ -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):