Skip to content
Open
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
6 changes: 4 additions & 2 deletions asyncmy/connection.pyx
Original file line number Diff line number Diff line change
Expand Up @@ -51,8 +51,10 @@ try:

DEFAULT_USER = getpass.getuser()
del getpass
except (ImportError, KeyError):
# KeyError occurs when there's no entry in OS database for a current user.
except (ImportError, KeyError, OSError):
# When there's no entry in OS database for a current user:
# KeyError is raised in Python 3.12 and below.
# OSError is raised in Python 3.13+
DEFAULT_USER = None

cdef set TEXT_TYPES = {
Expand Down