Applying patches directly from emails?
[notmuch-archives.git] / e7 / 0e32c2506da51ed7ba3d3c58743786a8726830
1 Return-Path: <prvs=374b26013=jrosenthal@jhu.edu>\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 36907431FBC\r
6         for <notmuch@notmuchmail.org>; Fri, 31 Oct 2014 10:33:41 -0700 (PDT)\r
7 X-Virus-Scanned: Debian amavisd-new at olra.theworths.org\r
8 X-Spam-Flag: NO\r
9 X-Spam-Score: -2.3\r
10 X-Spam-Level: \r
11 X-Spam-Status: No, score=-2.3 tagged_above=-999 required=5\r
12         tests=[RCVD_IN_DNSWL_MED=-2.3] autolearn=disabled\r
13 Received: from olra.theworths.org ([127.0.0.1])\r
14         by localhost (olra.theworths.org [127.0.0.1]) (amavisd-new, port 10024)\r
15         with ESMTP id yeClcEKzzHwo for <notmuch@notmuchmail.org>;\r
16         Fri, 31 Oct 2014 10:33:35 -0700 (PDT)\r
17 Received: from smtpauth.johnshopkins.edu (smtpauth.johnshopkins.edu\r
18         [162.129.8.150]) (using TLSv1 with cipher RC4-SHA (128/128 bits))\r
19         (No client certificate requested)\r
20         by olra.theworths.org (Postfix) with ESMTPS id 9CE73431FAF\r
21         for <notmuch@notmuchmail.org>; Fri, 31 Oct 2014 10:33:35 -0700 (PDT)\r
22 X-IronPort-AV: E=Sophos;i="5.07,295,1413259200"; d="scan'208";a="110278986"\r
23 Received: from guppy.hwcampus.jhu.edu (HELO localhost) ([10.161.32.234])\r
24         by IPEB2.johnshopkins.edu with ESMTP/TLS/AES128-SHA;\r
25         31 Oct 2014 13:33:33 -0400\r
26 From: Jesse Rosenthal <jrosenthal@jhu.edu>\r
27 To: notmuch@notmuchmail.org\r
28 Subject: [PATCH] test: Make gen-threads work with python3\r
29 Date: Fri, 31 Oct 2014 13:33:25 -0400\r
30 Message-Id: <1414776805-30000-1-git-send-email-jrosenthal@jhu.edu>\r
31 X-Mailer: git-send-email 2.1.2\r
32 X-BeenThere: notmuch@notmuchmail.org\r
33 X-Mailman-Version: 2.1.13\r
34 Precedence: list\r
35 List-Id: "Use and development of the notmuch mail system."\r
36         <notmuch.notmuchmail.org>\r
37 List-Unsubscribe: <http://notmuchmail.org/mailman/options/notmuch>,\r
38         <mailto:notmuch-request@notmuchmail.org?subject=unsubscribe>\r
39 List-Archive: <http://notmuchmail.org/pipermail/notmuch>\r
40 List-Post: <mailto:notmuch@notmuchmail.org>\r
41 List-Help: <mailto:notmuch-request@notmuchmail.org?subject=help>\r
42 List-Subscribe: <http://notmuchmail.org/mailman/listinfo/notmuch>,\r
43         <mailto:notmuch-request@notmuchmail.org?subject=subscribe>\r
44 X-List-Received-Date: Fri, 31 Oct 2014 17:33:41 -0000\r
45 \r
46 python3 doesn't allow dictionaries to be initialized with non-string\r
47 keywords. This presents problems on systems in which "python" means\r
48 "python3". We instead initalize the dictionary using the dict\r
49 comprehension and then update it with the values from the tree. This\r
50 will work with both python2 and python3.\r
51 ---\r
52  test/gen-threads.py | 4 ++--\r
53  1 file changed, 2 insertions(+), 2 deletions(-)\r
54 \r
55 diff --git a/test/gen-threads.py b/test/gen-threads.py\r
56 index 9fbb847..70fb1f6 100644\r
57 --- a/test/gen-threads.py\r
58 +++ b/test/gen-threads.py\r
59 @@ -2,7 +2,6 @@\r
60  # argv[1].  Each output line is a thread structure, where the n'th\r
61  # field is either a number giving the parent of message n or "None"\r
62  # for the root.\r
63 -\r
64  import sys\r
65  from itertools import chain, combinations\r
66  \r
67 @@ -28,6 +27,7 @@ while queue:\r
68      else:\r
69          # Expand node to_expand[0] with each possible set of children\r
70          for children in subsets(free):\r
71 -            ntree = dict(tree, **{child: to_expand[0] for child in children})\r
72 +            ntree = {child: to_expand[0] for child in children}\r
73 +            ntree.update(tree)\r
74              nfree = free.difference(children)\r
75              queue.append((ntree, nfree, to_expand[1:] + tuple(children)))\r
76 -- \r
77 2.1.2\r
78 \r