Skip to content

Add support for Python 3.13 #1190

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Nov 6, 2024
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
3 changes: 3 additions & 0 deletions .github/workflows/test.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,9 @@ jobs:
- db: "mariadb:10.6"
py: "3.12"

- db: "mariadb:10.6"
py: "3.13"

- db: "mariadb:lts"
py: "3.9"

Expand Down
6 changes: 4 additions & 2 deletions pymysql/connections.py
Original file line number Diff line number Diff line change
Expand Up @@ -40,8 +40,10 @@

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):

Check warning on line 43 in pymysql/connections.py

View check run for this annotation

Codecov / codecov/patch

pymysql/connections.py#L43

Added line #L43 was not covered by tests
# 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

DEBUG = False
Expand Down
1 change: 1 addition & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ classifiers = [
"Programming Language :: Python :: 3.10",
"Programming Language :: Python :: 3.11",
"Programming Language :: Python :: 3.12",
"Programming Language :: Python :: 3.13",
"Programming Language :: Python :: Implementation :: CPython",
"Programming Language :: Python :: Implementation :: PyPy",
"Intended Audience :: Developers",
Expand Down
Loading