浏览代码

fix `main` detection of `path_deploy()`

wangweimin 3 年之前
父节点
当前提交
20bb478d58
共有 1 个文件被更改,包括 2 次插入1 次删除
  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]