I believe you should use `env_id is not None` as None is an identity and `is` is used to compare identities while `==` is used to do equality comparisons. Better yet you could just check `not env_id`.

From PEP 8:

> Comparisons to singletons like None should always be done with is or is not, never the equality operators