From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp10.migadu.com ([2001:41d0:2:bcc0::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms5.migadu.com with LMTPS id 8Ji8BUKVm2LQTgEAbAwnHQ (envelope-from ) for ; Sat, 04 Jun 2022 19:24:18 +0200 Received: from aspmx1.migadu.com ([2001:41d0:2:bcc0::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp10.migadu.com with LMTPS id AIrLBEKVm2JX7AAAG6o9tA (envelope-from ) for ; Sat, 04 Jun 2022 19:24:18 +0200 Received: from mail.notmuchmail.org (yantan.tethera.net [IPv6:2a01:4f9:c011:7a79::1]) (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 B925245915 for ; Sat, 4 Jun 2022 19:24:17 +0200 (CEST) Received: from yantan.tethera.net (localhost [127.0.0.1]) by mail.notmuchmail.org (Postfix) with ESMTP id A0BDA5F7D7; Sat, 4 Jun 2022 17:23:42 +0000 (UTC) Received: from fethera.tethera.net (fethera.tethera.net [IPv6:2607:5300:60:c5::1]) by mail.notmuchmail.org (Postfix) with ESMTP id D3FAF5F7DA for ; Sat, 4 Jun 2022 17:23:38 +0000 (UTC) Received: by fethera.tethera.net (Postfix, from userid 1001) id 4F2555FC3F; Sat, 4 Jun 2022 13:23:38 -0400 (EDT) Received: (nullmailer pid 1150055 invoked by uid 1000); Sat, 04 Jun 2022 17:23:25 -0000 From: David Bremner To: notmuch@notmuchmail.org Subject: [PATCH v3 02/17] CLI/git: drop support for python < 3.2 Date: Sat, 4 Jun 2022 14:22:58 -0300 Message-Id: <20220604172313.1149879-3-david@tethera.net> X-Mailer: git-send-email 2.35.2 In-Reply-To: <20220604172313.1149879-1-david@tethera.net> References: <20220604172313.1149879-1-david@tethera.net> MIME-Version: 1.0 Message-ID-Hash: AQ6TRGR4VCNXQVO4EQVSAY32S3VAGVZC X-Message-ID-Hash: AQ6TRGR4VCNXQVO4EQVSAY32S3VAGVZC 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=1654363457; 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=ZSnAGVs8sAXNPppgLJvygxDal3MwigkBCVLYzzSdYHw=; b=Ew2dNBjI6ov4pkgV2VMaVCbUNZ24C4BEDF5Z6zV1Zwvmi6p57YbZb5o3/P5IcZAAOtG3U9 LBFsgrhbTVf3Q6ZlGc3Kbu5nlyqdujVYhUgH4VIHF+bHmvH4pBZnc8UTIVl1f/bkNGOrXq lfYjXz7L29uqwlqey/vTau8mXRdMcs3M2fHhX/9qv9Yl25+9knUtfKn2Jfpd9y/HNHO2OI TLcnCFswscYH4swxqtAKYvUTlia7YmmNYjT760CI/9YFxLbVYSajUNmyl1WxiMBp78EO9B zhuYBRiq8z157cQSPu3t8qz56KRr4cMawzkCLN9KrWSBCd1ad7nLcnWuKkQxNA== ARC-Seal: i=1; s=key1; d=yhetil.org; t=1654363457; a=rsa-sha256; cv=none; b=gAcAfQG/l/8ysecPRhWwfV34c2d+fcBrL6VIWLLHtp/nuomirtevCRrxfkO8eCqw+0yFTc CPnmFD+SJ171zhRemTVU8kLNOeEZG8N2awUgtvazNNWjmnwBbCik/QFzpoa6piILm90HRV Z5Uia72XUmKmvkl3ypgwrc2t8RWtZjA1HCMHUR3PPv9MxdnQaS6x5XmDPSVpRx1/4fSFkB uQfjtqqyQ9TTnUnuYBDT5Rxm1i/oCub5YkXmKiZ1H8MMbRZx/dr+64JhoY2VM8NjsOdg14 PfwMjHJtZ/8XuxCQbluZHoGFUiM21yeCowsM21WTU0yEtd6cKbAdegwWc/2kAg== ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=none; dmarc=none; spf=pass (aspmx1.migadu.com: domain of notmuch-bounces@notmuchmail.org designates 2a01:4f9:c011:7a79::1 as permitted sender) smtp.mailfrom=notmuch-bounces@notmuchmail.org X-Migadu-Spam-Score: -1.05 Authentication-Results: aspmx1.migadu.com; dkim=none; dmarc=none; spf=pass (aspmx1.migadu.com: domain of notmuch-bounces@notmuchmail.org designates 2a01:4f9:c011:7a79::1 as permitted sender) smtp.mailfrom=notmuch-bounces@notmuchmail.org X-Migadu-Queue-Id: B925245915 X-Spam-Score: -1.05 X-Migadu-Scanner: scn0.migadu.com X-TUID: /3X5u+tkW7Iv 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.py | 33 ++------------------------------- 1 file changed, 2 insertions(+), 31 deletions(-) diff --git a/notmuch-git.py b/notmuch-git.py index 04cdae0f..fb42e5bf 100644 --- a/notmuch-git.py +++ b/notmuch-git.py @@ -43,12 +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 _LOG = _logging.getLogger('nmbug') _LOG.setLevel(_logging.WARNING) @@ -68,31 +64,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