diff mbox series

[RESEND,b4,5/5] Add missing imports

Message ID 20241108-better-type-annotations-v1-5-ebaf0129d9e1@gmail.com (mailing list archive)
State New
Headers show
Series Resolve some static typing errors | expand

Commit Message

Tamir Duberstein Nov. 8, 2024, 12:31 p.m. UTC
Signed-off-by: Tamir Duberstein <tamird@gmail.com>
---
 src/b4/__init__.py         | 9 +++++----
 src/b4/diff.py             | 1 +
 src/b4/ez.py               | 2 ++
 src/b4/pr.py               | 2 ++
 src/b4/ty.py               | 1 +
 src/tests/test___init__.py | 1 +
 6 files changed, 12 insertions(+), 4 deletions(-)
diff mbox series

Patch

diff --git a/src/b4/__init__.py b/src/b4/__init__.py
index e71fbe7d8ea8d4ca19228690ce7c186cc91b81ad..7b1925da93e1b3feadf669cc188ab6fb030f67f4 100644
--- a/src/b4/__init__.py
+++ b/src/b4/__init__.py
@@ -8,12 +8,13 @@  import sys
 import gzip
 import os
 import fnmatch
-import email.utils
-import email.policy
-import email.parser
-import email.header
 import email.generator
+import email.header
+import email.message
+import email.parser
+import email.policy
 import email.quoprimime
+import email.utils
 import tempfile
 import pathlib
 import argparse
diff --git a/src/b4/diff.py b/src/b4/diff.py
index 743127ef0a1922eace81686e27cd0366f8e42f9c..1de3063ea0b3c73e4e3d8bfd4ec91b4c6f90cce6 100644
--- a/src/b4/diff.py
+++ b/src/b4/diff.py
@@ -11,6 +11,7 @@  import b4
 import b4.mbox
 import mailbox
 import email
+import email.message
 import email.parser
 import shutil
 import pathlib
diff --git a/src/b4/ez.py b/src/b4/ez.py
index 970631592d2139b12ee4a6a9a112081eee1de721..9494b005a4f47a7be9cb053cc6075dede29d4cb0 100644
--- a/src/b4/ez.py
+++ b/src/b4/ez.py
@@ -17,6 +17,8 @@  import datetime
 import json
 import shlex
 import email
+import email.policy
+import email.utils
 import pathlib
 import base64
 import textwrap
diff --git a/src/b4/pr.py b/src/b4/pr.py
index b6eb5d3933d7e0bb1224877f071bb19facd8dbd8..60f46f1e3fa96a52a9d667bffb43c2a75b89cc4e 100644
--- a/src/b4/pr.py
+++ b/src/b4/pr.py
@@ -13,7 +13,9 @@  import b4
 import re
 import json
 import email
+import email.message
 import email.parser
+import email.utils
 import argparse
 
 import urllib.parse
diff --git a/src/b4/ty.py b/src/b4/ty.py
index e1afb61280d2161a054d40ae78df0d4b33dbb41d..021588ff9e559cfd8aa7c6818cdeba750931e8f6 100644
--- a/src/b4/ty.py
+++ b/src/b4/ty.py
@@ -13,6 +13,7 @@  import re
 import email
 import email.message
 import email.policy
+import email.utils
 import json
 import argparse
 
diff --git a/src/tests/test___init__.py b/src/tests/test___init__.py
index 297e5120a8c8adf241660f06e9a83c1ff4a0fd3a..3e01c2f5e127cd1123d0fb8503493e396148ee73 100644
--- a/src/tests/test___init__.py
+++ b/src/tests/test___init__.py
@@ -35,6 +35,7 @@  def test_save_git_am_mbox(sampledir, tmp_path, source, regex, flags, ismbox):
             msgs = list(mbx)
         else:
             import email
+            import email.parser
             with open(f'{sampledir}/{source}.txt', 'rb') as fh:
                 msg = email.parser.BytesParser(policy=b4.emlpolicy, _class=email.message.EmailMessage).parse(fh)
             msgs = [msg]