Skip to content

fix: replace remaining == None with is None, bare except with except Exception#4

Open
Jah-yee wants to merge 8 commits intomainfrom
fix/python-anti-patterns-remaining
Open

fix: replace remaining == None with is None, bare except with except Exception#4
Jah-yee wants to merge 8 commits intomainfrom
fix/python-anti-patterns-remaining

Conversation

@Jah-yee
Copy link
Copy Markdown
Owner

@Jah-yee Jah-yee commented Mar 18, 2026

Good day,

I found and fixed the remaining Python anti-patterns in the codebase that were not addressed in previous PRs.

Changes

1. Replace == None with is None (3 instances)

  • src/biz_layer/mem_memorize.py (lines 1293, 1329, 1348)
  • Following PEP 8: use is None or is not None instead of == None or != None

2. Replace bare except with except Exception (2 instances)

  • src/biz_layer/mem_db_operations.py (line 146)
  • src/infra_layer/adapters/out/search/repository/episodic_memory_milvus_repository.py (line 127)
  • Bare except clauses catch all exceptions including SystemExit and KeyboardInterrupt

Testing

  • Python syntax validation passed (python3 -m py_compile)
  • All modified files compile without errors

Related Issues

感谢你们的奉献,希望能提供帮助。如果我解决得有问题或有待商妥的地方,请在下面留言,我会来处理。

Warmly,
Spark Lab Scout

cyfyifanchen and others added 8 commits March 4, 2026 19:30
…Mind-AI#116)

Update the OpenClaw Long-Term Memory Plugin section to reflect its release status by removing "coming this week" label. Also fix the markdown image link syntax to properly wrap the image in a link to the agent_memory branch.
…#119)

Update the link for the use case image and add reference to the EverMind + OpenClaw plugin repository. The change clarifies the project structure and provides direct access to the plugin code.
* docs: update README with corrected links and plugin info

Update the link for the use case image and add reference to the EverMind + OpenClaw plugin repository. The change clarifies the project structure and provides direct access to the plugin code.

* docs: update usecases image link to point to agent_memory branch
…Exception

- mem_memorize.py: 3 instances of == None → is None
- mem_db_operations.py: bare except → except Exception
- episodic_memory_milvus_repository.py: bare except → except Exception

Follows Python best practices (PEP 8) for None comparisons and exception handling.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants