Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions pymongo/asynchronous/srv_resolver.py
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,7 @@ async def get_options(self) -> Optional[str]:
# No TXT records
return None
except Exception as exc:
raise ConfigurationError(str(exc)) from None
raise ConfigurationError(str(exc)) from exc
if len(results) > 1:
raise ConfigurationError("Only one TXT record is supported")
return (b"&".join([b"".join(res.strings) for res in results])).decode("utf-8") # type: ignore[attr-defined]
Expand All @@ -122,7 +122,7 @@ async def _resolve_uri(self, encapsulate_errors: bool) -> resolver.Answer:
# Raise the original error.
raise
# Else, raise all errors as ConfigurationError.
raise ConfigurationError(str(exc)) from None
raise ConfigurationError(str(exc)) from exc
return results

async def _get_srv_response_and_hosts(
Expand All @@ -145,8 +145,8 @@ async def _get_srv_response_and_hosts(
)
try:
nlist = srv_host.split(".")[1:][-self.__slen :]
except Exception:
raise ConfigurationError(f"Invalid SRV host: {node[0]}") from None
except Exception as exc:
raise ConfigurationError(f"Invalid SRV host: {node[0]}") from exc
if self.__plist != nlist:
raise ConfigurationError(f"Invalid SRV host: {node[0]}")
if self.__srv_max_hosts:
Expand Down
8 changes: 4 additions & 4 deletions pymongo/synchronous/srv_resolver.py
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,7 @@ def get_options(self) -> Optional[str]:
# No TXT records
return None
except Exception as exc:
raise ConfigurationError(str(exc)) from None
raise ConfigurationError(str(exc)) from exc
if len(results) > 1:
raise ConfigurationError("Only one TXT record is supported")
return (b"&".join([b"".join(res.strings) for res in results])).decode("utf-8") # type: ignore[attr-defined]
Expand All @@ -122,7 +122,7 @@ def _resolve_uri(self, encapsulate_errors: bool) -> resolver.Answer:
# Raise the original error.
raise
# Else, raise all errors as ConfigurationError.
raise ConfigurationError(str(exc)) from None
raise ConfigurationError(str(exc)) from exc
return results

def _get_srv_response_and_hosts(
Expand All @@ -145,8 +145,8 @@ def _get_srv_response_and_hosts(
)
try:
nlist = srv_host.split(".")[1:][-self.__slen :]
except Exception:
raise ConfigurationError(f"Invalid SRV host: {node[0]}") from None
except Exception as exc:
raise ConfigurationError(f"Invalid SRV host: {node[0]}") from exc
if self.__plist != nlist:
raise ConfigurationError(f"Invalid SRV host: {node[0]}")
if self.__srv_max_hosts:
Expand Down
2 changes: 1 addition & 1 deletion test/lambda/build_internal.sh
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#!/bin/bash -ex

cd /src
PYTHON=/opt/python/cp39-cp39/bin/python
PYTHON=/opt/python/cp310-cp310/bin/python
$PYTHON -m pip install -v -e .
2 changes: 1 addition & 1 deletion test/lambda/template.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ Resources:
Variables:
MONGODB_URI: !Ref MongoDbUri
Handler: app.lambda_handler
Runtime: python3.9
Runtime: python3.10
Architectures:
- x86_64
Events:
Expand Down
Loading