Return-Path: X-Original-To: notmuch@notmuchmail.org Delivered-To: notmuch@notmuchmail.org Received: from localhost (localhost [127.0.0.1]) by olra.theworths.org (Postfix) with ESMTP id 341E9429E34 for ; Wed, 14 Dec 2011 02:59:00 -0800 (PST) X-Virus-Scanned: Debian amavisd-new at olra.theworths.org X-Spam-Flag: NO X-Spam-Score: 0 X-Spam-Level: X-Spam-Status: No, score=0 tagged_above=-999 required=5 tests=[none] autolearn=disabled Received: from olra.theworths.org ([127.0.0.1]) by localhost (olra.theworths.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id myKyHXrKY+yO for ; Wed, 14 Dec 2011 02:58:59 -0800 (PST) Received: from mail.cryptobitch.de (cryptobitch.de [88.198.7.68]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by olra.theworths.org (Postfix) with ESMTPS id CF328429E35 for ; Wed, 14 Dec 2011 02:58:58 -0800 (PST) Received: from mail.jade-hamburg.de (unknown [85.183.11.228]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by mail.cryptobitch.de (Postfix) with ESMTPSA id 804EB50F615 for ; Wed, 14 Dec 2011 11:58:57 +0100 (CET) Received: by mail.jade-hamburg.de (Postfix, from userid 401) id 00B94DF2A1; Wed, 14 Dec 2011 11:58:56 +0100 (CET) Received: from thinkbox.jade-hamburg.de (unknown [85.183.11.228]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (No client certificate requested) (Authenticated sender: teythoon) by mail.jade-hamburg.de (Postfix) with ESMTPSA id 10B30DF2A4; Wed, 14 Dec 2011 11:58:48 +0100 (CET) Received: from teythoon by thinkbox.jade-hamburg.de with local (Exim 4.77) (envelope-from ) id 1RamXr-0004Me-Ts; Wed, 14 Dec 2011 11:58:43 +0100 From: Justus Winter <4winter@informatik.uni-hamburg.de> To: notmuch@notmuchmail.org Subject: [PATCH 5/7] py3k: the basestring and unicode types are removed in python 3 Date: Wed, 14 Dec 2011 11:58:23 +0100 Message-Id: <1323860305-15802-6-git-send-email-4winter@informatik.uni-hamburg.de> X-Mailer: git-send-email 1.7.7.3 In-Reply-To: <1323860305-15802-1-git-send-email-4winter@informatik.uni-hamburg.de> References: <1323860305-15802-1-git-send-email-4winter@informatik.uni-hamburg.de> X-BeenThere: notmuch@notmuchmail.org X-Mailman-Version: 2.1.13 Precedence: list List-Id: "Use and development of the notmuch mail system." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 14 Dec 2011 10:59:00 -0000 --- bindings/python/notmuch/globals.py | 5 +++-- 1 files changed, 3 insertions(+), 2 deletions(-) diff --git a/bindings/python/notmuch/globals.py b/bindings/python/notmuch/globals.py index 99e6a10..c52790c 100644 --- a/bindings/python/notmuch/globals.py +++ b/bindings/python/notmuch/globals.py @@ -17,6 +17,7 @@ along with notmuch. If not, see . Copyright 2010 Sebastian Spaeth ' """ +import sys from ctypes import CDLL, c_char_p, c_int, Structure, POINTER #----------------------------------------------------------------------------- @@ -200,9 +201,9 @@ def _str(value): C++ code expects strings to be well formatted and unicode strings to have no null bytes.""" - if not isinstance(value, basestring): + if not isinstance(value, basestring if sys.version_info[0] == 2 else str): raise TypeError("Expected str or unicode, got %s" % str(type(value))) - if isinstance(value, unicode): + if sys.version_info[0] == 3 or isinstance(value, unicode): return value.encode('UTF-8') return value -- 1.7.7.3