Skip to content

Commit

Permalink
Allow getpass.getuser() to fail
Browse files Browse the repository at this point in the history
  • Loading branch information
chrisburr committed Aug 4, 2021
1 parent 0a8af23 commit 7a595f5
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion aiomysql/connection.py
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,10 @@
from .utils import _ConnectionContextManager, _ContextManager
from .log import logger

DEFAULT_USER = getpass.getuser()
try:
DEFAULT_USER = getpass.getuser()
except KeyError:
DEFAULT_USER = "unknown"


def connect(host="localhost", user=None, password="",
Expand Down

0 comments on commit 7a595f5

Please sign in to comment.