Browse Source

fix `main` detection of `path_deploy()`

wangweimin 3 năm trước cách đây
mục cha
commit
20bb478d58
1 tập tin đã thay đổi với 2 bổ sung1 xóa
  1. 2 1
      pywebio/platform/path_deploy.py

+ 2 - 1
pywebio/platform/path_deploy.py

@@ -38,7 +38,8 @@ def identifiers_info(code):
     for node in tree.body:
         if isinstance(node, ast.Assign):
             for name in node.targets:
-                identifier2doc[name.id] = ''
+                if hasattr(name, 'id'):
+                    identifier2doc[name.id] = ''
         elif isinstance(node, (ast.FunctionDef, ast.AsyncFunctionDef, ast.ClassDef)):
             doc_string = ast.get_docstring(node) or ''
             title = doc_string.split('\n\n')[0]