Subject: [PATCH] * lisp/progmodes/python.el (python--import-sources): Fix regexp

From: Augusto Stoffel <[email-masked]>
Date: Mon, 20 Feb 2023 10:54:07 +0100

Tags: patch

Please include this small bug fix concerning the Python import commands
in Emacs 29.

.pyc files are binary bytecode and not relevant for the purposes of the
import management.  I originally confused them with .pyx files, which
are Cython source files (a Python dialect).

>From 5332794f25d5d7272271981d8c463d112a1d8b1e Mon Sep 17 00:00:00 2001
From: Augusto Stoffel <[email-masked]>
Date: Mon, 20 Feb 2023 10:49:22 +0100
Subject: [PATCH] * lisp/progmodes/python.el (python--import-sources): Fix
 regexp

---
 lisp/progmodes/python.el | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/lisp/progmodes/python.el b/lisp/progmodes/python.el
index 0d714c31e9e..eab5e70af33 100644
--- a/lisp/progmodes/python.el
+++ b/lisp/progmodes/python.el
@@ -6376,7 +6376,7 @@ python--import-sources
   "List files containing Python imports that may be useful in the current buffer."
   (if-let (((featurep 'project))        ;For compatibility with Emacs < 26
            (proj (project-current)))
-      (seq-filter (lambda (s) (string-match-p "\\.py[ciw]?\\'" s))
+      (seq-filter (lambda (s) (string-match-p "\\.py[iwx]?\\'" s))
                   (project-files proj))
     (list default-directory)))
 
-- 
2.39.2