Control: tags 1067796 + patch

On Thu 2024-03-28 13:09:48 +0800, Sean Whitton wrote:
> Please take a look into this test suite failure for your script.

The attached patch should clean things up now that argcomplete is
annotated.  in my local tests, the script runs and exits cleanly.

This patch is worth applying generally, but given the flux around mypy
typing, i would also be fine with just recording the output of mypy
--strict instead of failing hard on it.

         --dkg

From b522c1cc6201f75ab6103954016bbb719d4dd2fa Mon Sep 17 00:00:00 2001
From: Daniel Kahn Gillmor <d...@fifthhorseman.net>
Date: Tue, 30 Jan 2024 15:40:58 -0500
Subject: [PATCH] email-print-mime-structure: clean up typechecking
 (argcomplete types are known)

(and, update copyright years)
---
 email-print-mime-structure | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

diff --git a/email-print-mime-structure b/email-print-mime-structure
index b7646e0..7635f53 100755
--- a/email-print-mime-structure
+++ b/email-print-mime-structure
@@ -2,7 +2,7 @@
 # PYTHON_ARGCOMPLETE_OK
 # -*- coding: utf-8 -*-
 
-# Copyright (C) 2019 Daniel Kahn Gillmor
+# Copyright (C) 2019-2024 Daniel Kahn Gillmor
 #
 # This program is free software: you can redistribute it and/or modify
 # it under the terms of the GNU General Public License as published by
@@ -39,6 +39,7 @@ import subprocess
 
 from argparse import ArgumentParser, Namespace
 from typing import Optional, Union, List, Tuple, Any
+from types import ModuleType
 from email.charset import Charset
 from email.message import Message
 
@@ -47,8 +48,9 @@ try:
 except ImportError:
     pgpy = None
 
+argcomplete:Optional[ModuleType]
 try:
-    import argcomplete #type: ignore
+    import argcomplete
 except ImportError:
     argcomplete = None
 
-- 
2.43.0

Attachment: signature.asc
Description: PGP signature

Reply via email to