diff --git a/gnu/packages/python.scm b/gnu/packages/python.scm
index 6b4d450599fce113bbb9a4afc2026524772bfdf4..bc56d7a2daf255f81a0fba4e2bbf097018f1b7ac 100644
--- a/gnu/packages/python.scm
+++ b/gnu/packages/python.scm
@@ -142,9 +142,13 @@ (define-public python-2
          (alist-cons-before
           'configure 'patch-lib-shells
           (lambda _
-            (substitute* '("Lib/subprocess.py"
-                           "Lib/distutils/tests/test_spawn.py"
-                           "Lib/test/test_subprocess.py")
+            ;; Filter for existing files, since some may not exist in all
+            ;; versions of python that are built with this recipe.
+            (substitute* (filter file-exists?
+                                 '("Lib/subprocess.py"
+                                   "Lib/popen2.py"
+                                   "Lib/distutils/tests/test_spawn.py"
+                                   "Lib/test/test_subprocess.py"))
               (("/bin/sh") (which "sh"))))
           (alist-cons-before
            'check 'pre-check