From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp11.migadu.com ([2001:41d0:2:4a6f::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms5.migadu.com with LMTPS id GE7YNM9DgWK3EgAAbAwnHQ (envelope-from ) for ; Sun, 15 May 2022 20:17:51 +0200 Received: from aspmx1.migadu.com ([2001:41d0:2:4a6f::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp11.migadu.com with LMTPS id EFDKNM9DgWLDhAEA9RJhRA (envelope-from ) for ; Sun, 15 May 2022 20:17:51 +0200 Received: from mail.notmuchmail.org (yantan.tethera.net [135.181.149.255]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by aspmx1.migadu.com (Postfix) with ESMTPS id AD312A224 for ; Sun, 15 May 2022 20:17:51 +0200 (CEST) Received: from yantan.tethera.net (localhost [127.0.0.1]) by mail.notmuchmail.org (Postfix) with ESMTP id 31F6C5F763; Sun, 15 May 2022 18:17:24 +0000 (UTC) Received: from fethera.tethera.net (fethera.tethera.net [198.245.60.197]) by mail.notmuchmail.org (Postfix) with ESMTP id 29A515F6C8 for ; Sun, 15 May 2022 18:17:21 +0000 (UTC) Received: by fethera.tethera.net (Postfix, from userid 1001) id 107F75FC1F; Sun, 15 May 2022 14:17:19 -0400 (EDT) Received: (nullmailer pid 57802 invoked by uid 1000); Sun, 15 May 2022 18:17:13 -0000 From: David Bremner To: notmuch@notmuchmail.org Subject: [PATCH 02/17] CLI/git: drop support for python < 3.2 Date: Sun, 15 May 2022 15:14:07 -0300 Message-Id: <20220515181421.57088-3-david@tethera.net> X-Mailer: git-send-email 2.35.2 In-Reply-To: <20220515181421.57088-1-david@tethera.net> References: <20220515181421.57088-1-david@tethera.net> MIME-Version: 1.0 Message-ID-Hash: AVI5AKLDJ7OT56SQVZF7QQ5LRW5XKEOI X-Message-ID-Hash: AVI5AKLDJ7OT56SQVZF7QQ5LRW5XKEOI X-MailFrom: bremner@tethera.net X-Mailman-Rule-Misses: dmarc-mitigation; no-senders; approved; emergency; loop; banned-address; member-moderation; header-match-notmuch.notmuchmail.org-0; nonmember-moderation; administrivia; implicit-dest; max-recipients; max-size; news-moderation; no-subject; digests; suspicious-header X-Mailman-Version: 3.3.3 Precedence: list List-Id: "Use and development of the notmuch mail system." List-Help: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit X-Migadu-Flow: FLOW_IN X-Migadu-To: larch@yhetil.org X-Migadu-Country: DE ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=yhetil.org; s=key1; t=1652638671; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references:list-id:list-help: list-owner:list-unsubscribe:list-subscribe:list-post; bh=zVQjSbPLAk7TvxTh3KXe5AYzZKNRRx2Ifm0qH7TG8aE=; b=iLGCYh8RDSK7pEmEzNQCjvZYhVyHoByOioZrDWu0YaMC6bkkbOsnwM76BzdOZp/1SBQ4E0 3MWzt7y4DexEQk8P6Ea2zFkt2LUTjm9IVsGogbMUQeVm9C81u81L5i/NCiJvFMzlK4LOmB l5/jJfCNcFXMAZ5JJ7XHTl0sRVGCDIbexJr3VUspJwh3a054ANp8D5SeWTNekIZ9kPvL3E OLNU5ATkGwQVHjALwi3MK9UfaJl+rIdpMkVTGXvtjAJEzSlstuVsmsLQ6zOimx5TyGDOza wqOKLvk0Iehb85pFKp3Ot8K//XSH/Whkcqpt6wIK/ko4dzxHT04E2U2xQ5IkIg== ARC-Seal: i=1; s=key1; d=yhetil.org; t=1652638671; a=rsa-sha256; cv=none; b=Uk/TBVuuFEwti5x7vITWsupovxevNEB3XCliAdiKOuJ2gruyv/slRO3Bzy1WVMMUkHHpGu g6DTBw3rUAUpaOpxpX8yDJhQ3tH19pMXQ/mItPc1IscK3704i8TuL+m7UpxcCBCso8pgqX LmBpICMDHcbnW9BixAfpgqUooCw3Tl0b2XuBzHdbRjF7wQnaFobknQTxstAdgt5gu0g7gq UD0bvvJZ1l8er6q76sLEhi3+oPRCi0WSIN8WxsH+vJbVAJv3CXGJcDRSMZL7WMshEbxes/ bUAvpjpffXYaIRUn3WO6yKuTd+Q1yw2fTjMYWwkBWS+wPB3xay8VZk3AoRieOA== ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=none; dmarc=none; spf=pass (aspmx1.migadu.com: domain of notmuch-bounces@notmuchmail.org designates 135.181.149.255 as permitted sender) smtp.mailfrom=notmuch-bounces@notmuchmail.org X-Migadu-Spam-Score: -1.45 Authentication-Results: aspmx1.migadu.com; dkim=none; dmarc=none; spf=pass (aspmx1.migadu.com: domain of notmuch-bounces@notmuchmail.org designates 135.181.149.255 as permitted sender) smtp.mailfrom=notmuch-bounces@notmuchmail.org X-Migadu-Queue-Id: AD312A224 X-Spam-Score: -1.45 X-Migadu-Scanner: scn0.migadu.com X-TUID: Kd+ED+H3p7Wc Debian stable had python 3.4.2 3 releases ago (approximately 6 years ago), so attempting to keep track of the changes in python is probably no longer worthwhile. We already require python 3.5 for the python-cffi bindings (although those are not yet used in notmuch-git). --- notmuch-git.in | 34 ++-------------------------------- 1 file changed, 2 insertions(+), 32 deletions(-) diff --git a/notmuch-git.in b/notmuch-git.in index dd30b5be..5d6e29f0 100755 --- a/notmuch-git.in +++ b/notmuch-git.in @@ -43,13 +43,8 @@ import subprocess as _subprocess import sys as _sys import tempfile as _tempfile import textwrap as _textwrap -try: # Python 3 - from urllib.parse import quote as _quote - from urllib.parse import unquote as _unquote -except ImportError: # Python 2 - from urllib import quote as _quote - from urllib import unquote as _unquote - +from urllib.parse import quote as _quote +from urllib.parse import unquote as _unquote __version__ = '@NOTMUCH_VERSION@' @@ -71,31 +66,6 @@ _TAG_FILE_REGEX = _re.compile(_TAG_DIRECTORY + '(?P[^/]*)/(?P[^/]*)') # magic hash for Git (git hash-object -t blob /dev/null) _EMPTYBLOB = 'e69de29bb2d1d6434b8b29ae775ad8c2e48c5391' - -try: - getattr(_tempfile, 'TemporaryDirectory') -except AttributeError: # Python < 3.2 - class _TemporaryDirectory(object): - """ - Fallback context manager for Python < 3.2 - - See PEP 343 for details on context managers [1]. - - [1]: https://www.python.org/dev/peps/pep-0343/ - """ - def __init__(self, **kwargs): - self.name = _tempfile.mkdtemp(**kwargs) - - def __enter__(self): - return self.name - - def __exit__(self, type, value, traceback): - _shutil.rmtree(self.name) - - - _tempfile.TemporaryDirectory = _TemporaryDirectory - - def _hex_quote(string, safe='+@=:,'): """ quote('abc def') -> 'abc%20def'. -- 2.35.2