فهرست منبع

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:
     for node in tree.body:
         if isinstance(node, ast.Assign):
         if isinstance(node, ast.Assign):
             for name in node.targets:
             for name in node.targets:
-                identifier2doc[name.id] = ''
+                if hasattr(name, 'id'):
+                    identifier2doc[name.id] = ''
         elif isinstance(node, (ast.FunctionDef, ast.AsyncFunctionDef, ast.ClassDef)):
         elif isinstance(node, (ast.FunctionDef, ast.AsyncFunctionDef, ast.ClassDef)):
             doc_string = ast.get_docstring(node) or ''
             doc_string = ast.get_docstring(node) or ''
             title = doc_string.split('\n\n')[0]
             title = doc_string.split('\n\n')[0]