Skip to content

Commit

Permalink
Merge pull request #28 from fliiiix/bugfix/python312-support
Browse files Browse the repository at this point in the history
Add support for Python 3.12
  • Loading branch information
csachs committed Apr 9, 2024
2 parents 16b9dd4 + 9107658 commit fbb9d72
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 4 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ jobs:
runs-on: ubuntu-latest
strategy:
matrix:
python-version: ["3.8", "3.9", "3.10", "3.11"]
python-version: ["3.8", "3.9", "3.10", "3.11", "3.12"]
name: Python ${{ matrix.python-version }} testing
steps:
- uses: actions/checkout@v3
Expand Down
13 changes: 10 additions & 3 deletions pflake8/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -52,13 +52,20 @@ class DivertingConfigParser(ConfigParserTomlMixin, configparser.ConfigParser):
pass


class DivertingSafeConfigParser(ConfigParserTomlMixin, configparser.SafeConfigParser):
pass
try:

class DivertingSafeConfigParser(
ConfigParserTomlMixin, configparser.SafeConfigParser
):
pass

configparser.SafeConfigParser = DivertingSafeConfigParser
except AttributeError:
pass # does not exist on Python 3.12 (https://github.com/python/cpython/issues/89336#issuecomment-1094366625)


configparser.RawConfigParser = DivertingRawConfigParser
configparser.ConfigParser = DivertingConfigParser
configparser.SafeConfigParser = DivertingSafeConfigParser


class FixFilenames(ast.NodeTransformer):
Expand Down

0 comments on commit fbb9d72

Please sign in to comment.