File: python3.14-compat.patch

package info (click to toggle)
importmagic 0.1.7-8
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 1,296 kB
  • sloc: python: 5,816; makefile: 5
file content (17 lines) | stat: -rw-r--r-- 763 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
Author: Diane Trout <diane@ghic.org>
Description: ast.Str was deprecated back in Python 3.8.
Forwarded: https://github.com/alecthomas/importmagic/issues/68

--- a/importmagic/index.py
+++ b/importmagic/index.py
@@ -404,8 +404,8 @@
         for name in filter(is_name, node.targets):
             if name.id == '__all__' and isinstance(node.value, ast.List):
                 for subnode in node.value.elts:
-                    if isinstance(subnode, ast.Str):
-                        self._tree.add_explicit_export(subnode.s, 1.2)
+                    if isinstance(subnode, ast.Constant):
+                        self._tree.add_explicit_export(subnode.value, 1.2)
             elif not name.id.startswith('_'):
                 self._tree.add(name.id, 1.1)