Skip to content
This repository was archived by the owner on Aug 19, 2025. It is now read-only.

Commit 0f80142

Browse files
manlixaminalaee
andauthored
Use built-in method in _get_backend (#406)
Co-authored-by: Amin Alaee <[email protected]>
1 parent 5fc7370 commit 0f80142

File tree

1 file changed

+3
-4
lines changed

1 file changed

+3
-4
lines changed

databases/core.py

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -221,10 +221,9 @@ def force_rollback(self) -> typing.Iterator[None]:
221221
self._force_rollback = initial
222222

223223
def _get_backend(self) -> str:
224-
try:
225-
return self.SUPPORTED_BACKENDS[self.url.scheme]
226-
except KeyError:
227-
return self.SUPPORTED_BACKENDS[self.url.dialect]
224+
return self.SUPPORTED_BACKENDS.get(
225+
self.url.scheme, self.SUPPORTED_BACKENDS[self.url.dialect]
226+
)
228227

229228

230229
class Connection:

0 commit comments

Comments
 (0)