MCPcopy Create free account
hub / github.com/mongodb/mongo-python-driver / _getenv_int

Function _getenv_int

pymongo/pool_options.py:150–158  ·  view source on GitHub ↗

Like os.getenv but returns an int, or None if the value is missing/malformed.

(key: str)

Source from the content-addressed store, hash-verified

148
149
150def _getenv_int(key: str) -> Optional[int]:
151 """Like os.getenv but returns an int, or None if the value is missing/malformed."""
152 val = os.getenv(key)
153 if not val:
154 return None
155 try:
156 return int(val)
157 except ValueError:
158 return None
159
160
161def _metadata_env() -> dict[str, Any]:

Callers 1

_metadata_envFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected