Skip to content

Commit cc81337

Browse files
Potential fix for pull request finding 'Empty except'
Co-authored-by: Copilot Autofix powered by AI <223894421+github-code-quality[bot]@users.noreply.github.com>
1 parent 1cf50b6 commit cc81337

1 file changed

Lines changed: 6 additions & 2 deletions

File tree

plugins/management/commands/plugin.py

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -302,8 +302,12 @@ def _detect_plugin_class(self, dir_name, dir_path):
302302
return True
303303
if 'PLUGIN_INFO' in content:
304304
return True
305-
except Exception:
306-
pass
305+
except Exception as e:
306+
self.stdout.write(
307+
self.style.WARNING(
308+
f'读取插件 {dir_name} 的 __init__.py 失败: {e}'
309+
)
310+
)
307311

308312
for item in os.listdir(dir_path):
309313
if not item.endswith('.py') or item == '__init__.py':

0 commit comments

Comments
 (0)