Skip to content

Commit

Permalink
Merge pull request #629 from mgorny/tomli
Browse files Browse the repository at this point in the history
Use tomli in place of unmaintained toml package
  • Loading branch information
hhatto committed Oct 12, 2022
2 parents 02bcfbf + d083694 commit a1340ae
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
10 changes: 5 additions & 5 deletions autopep8.py
Expand Up @@ -4040,22 +4040,22 @@ def read_config(args, parser):

def read_pyproject_toml(args, parser):
"""Read pyproject.toml and load configuration."""
import toml
import tomli

config = None

if os.path.exists(args.global_config):
with open(args.global_config) as fp:
config = toml.load(fp)
with open(args.global_config, "rb") as fp:
config = tomli.load(fp)

if not args.ignore_local_config:
parent = tail = args.files and os.path.abspath(
os.path.commonprefix(args.files))
while tail:
pyproject_toml = os.path.join(parent, "pyproject.toml")
if os.path.exists(pyproject_toml):
with open(pyproject_toml) as fp:
config = toml.load(fp)
with open(pyproject_toml, "rb") as fp:
config = tomli.load(fp)
break
(parent, tail) = os.path.split(parent)

Expand Down
2 changes: 1 addition & 1 deletion setup.py
Expand Up @@ -10,7 +10,7 @@


INSTALL_REQUIRES = (
['pycodestyle >= 2.9.1', 'toml']
['pycodestyle >= 2.9.1', 'tomli']
)


Expand Down

0 comments on commit a1340ae

Please sign in to comment.