1 Return-Path: <novalazy@gmail.com>
\r
2 X-Original-To: notmuch@notmuchmail.org
\r
3 Delivered-To: notmuch@notmuchmail.org
\r
4 Received: from localhost (localhost [127.0.0.1])
\r
5 by olra.theworths.org (Postfix) with ESMTP id 944ED431FD8
\r
6 for <notmuch@notmuchmail.org>; Wed, 16 Apr 2014 06:00:17 -0700 (PDT)
\r
7 X-Virus-Scanned: Debian amavisd-new at olra.theworths.org
\r
11 X-Spam-Status: No, score=-0.799 tagged_above=-999 required=5
\r
12 tests=[DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1,
\r
13 FREEMAIL_FROM=0.001, RCVD_IN_DNSWL_LOW=-0.7] autolearn=disabled
\r
14 Received: from olra.theworths.org ([127.0.0.1])
\r
15 by localhost (olra.theworths.org [127.0.0.1]) (amavisd-new, port 10024)
\r
16 with ESMTP id oRmfF7ICliGT for <notmuch@notmuchmail.org>;
\r
17 Wed, 16 Apr 2014 06:00:12 -0700 (PDT)
\r
18 Received: from mail-pa0-f52.google.com (mail-pa0-f52.google.com
\r
19 [209.85.220.52]) (using TLSv1 with cipher RC4-SHA (128/128 bits))
\r
20 (No client certificate requested)
\r
21 by olra.theworths.org (Postfix) with ESMTPS id D3ADB431FBF
\r
22 for <notmuch@notmuchmail.org>; Wed, 16 Apr 2014 05:59:54 -0700 (PDT)
\r
23 Received: by mail-pa0-f52.google.com with SMTP id rd3so10871433pab.25
\r
24 for <notmuch@notmuchmail.org>; Wed, 16 Apr 2014 05:59:54 -0700 (PDT)
\r
25 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113;
\r
26 h=from:to:cc:subject:date:message-id:in-reply-to:references;
\r
27 bh=ysDXZYN1HSpqRnTThvM90TRhsDZIjKzf1KldDFF1sXk=;
\r
28 b=ROPpKGs/UmEOoGD7GEzp3L0kdxsaN3Y3SV83+/sy6TXycYukMllXUJXBbtdVCUkL13
\r
29 BotG0M+fvq1YXZ4pYFNbtWiMBjKdm2bYc+NIwhRUNN5YD/rN3vS0gHwIwW60O7DyWYau
\r
30 f7IRdcucurg6UMW0FB+JZGZW8JFNSa4vm/Nr2kRQ84+mpP9k0Rr7AxezsEq4iDvW8eNl
\r
31 fHXQe0sAJZs2rL2itDk01aVTyrfovaEboB1ejfquqNQ8gOrENmSVJ2vaGD0WAEJWYOkS
\r
32 JsTNYHwnK10eHYxm13iwgspPrJIx+8bWpqOQzrMZO/0Op7Pl11iZ5bq/QsmveV9ATTM9
\r
34 X-Received: by 10.68.197.99 with SMTP id it3mr8230605pbc.37.1397653194096;
\r
35 Wed, 16 Apr 2014 05:59:54 -0700 (PDT)
\r
36 Received: from localhost (215.42.233.220.static.exetel.com.au.
\r
37 [220.233.42.215]) by mx.google.com with ESMTPSA id
\r
38 id10sm46933724pbc.35.2014.04.16.05.59.51 for <multiple recipients>
\r
39 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128);
\r
40 Wed, 16 Apr 2014 05:59:52 -0700 (PDT)
\r
41 From: Peter Wang <novalazy@gmail.com>
\r
42 To: notmuch@notmuchmail.org
\r
43 Subject: [PATCH v2 03/10] python: handle return status of database close and
\r
45 Date: Wed, 16 Apr 2014 22:59:18 +1000
\r
46 Message-Id: <1397653165-15620-4-git-send-email-novalazy@gmail.com>
\r
47 X-Mailer: git-send-email 1.8.4
\r
48 In-Reply-To: <1397653165-15620-1-git-send-email-novalazy@gmail.com>
\r
49 References: <1397653165-15620-1-git-send-email-novalazy@gmail.com>
\r
50 X-BeenThere: notmuch@notmuchmail.org
\r
51 X-Mailman-Version: 2.1.13
\r
53 List-Id: "Use and development of the notmuch mail system."
\r
54 <notmuch.notmuchmail.org>
\r
55 List-Unsubscribe: <http://notmuchmail.org/mailman/options/notmuch>,
\r
56 <mailto:notmuch-request@notmuchmail.org?subject=unsubscribe>
\r
57 List-Archive: <http://notmuchmail.org/pipermail/notmuch>
\r
58 List-Post: <mailto:notmuch@notmuchmail.org>
\r
59 List-Help: <mailto:notmuch-request@notmuchmail.org?subject=help>
\r
60 List-Subscribe: <http://notmuchmail.org/mailman/listinfo/notmuch>,
\r
61 <mailto:notmuch-request@notmuchmail.org?subject=subscribe>
\r
62 X-List-Received-Date: Wed, 16 Apr 2014 13:00:17 -0000
\r
64 Throw an exception if notmuch_database_close or notmuch_database_destroy
\r
67 bindings/python/notmuch/database.py | 12 ++++++++----
\r
68 1 file changed, 8 insertions(+), 4 deletions(-)
\r
70 diff --git a/bindings/python/notmuch/database.py b/bindings/python/notmuch/database.py
\r
71 index 7ddf5cf..5b58e09 100644
\r
72 --- a/bindings/python/notmuch/database.py
\r
73 +++ b/bindings/python/notmuch/database.py
\r
74 @@ -157,11 +157,13 @@ class Database(object):
\r
76 _destroy = nmlib.notmuch_database_destroy
\r
77 _destroy.argtypes = [NotmuchDatabaseP]
\r
78 - _destroy.restype = None
\r
79 + _destroy.restype = c_uint
\r
83 - self._destroy(self._db)
\r
84 + status = self._destroy(self._db)
\r
85 + if status != STATUS.SUCCESS:
\r
86 + raise NotmuchError(status)
\r
88 def _assert_db_is_initialized(self):
\r
89 """Raises :exc:`NotInitializedError` if self._db is `None`"""
\r
90 @@ -217,7 +219,7 @@ class Database(object):
\r
92 _close = nmlib.notmuch_database_close
\r
93 _close.argtypes = [NotmuchDatabaseP]
\r
94 - _close.restype = None
\r
95 + _close.restype = c_uint
\r
99 @@ -231,7 +233,9 @@ class Database(object):
\r
103 - self._close(self._db)
\r
104 + status = self._close(self._db)
\r
105 + if status != STATUS.SUCCESS:
\r
106 + raise NotmuchError(status)
\r
108 def __enter__(self):
\r