Skip to content

Commit

Permalink
Be compatible with Python 3.10
Browse files Browse the repository at this point in the history
  • Loading branch information
zaneselvans committed Sep 15, 2023
1 parent 7511d1e commit ac28bf5
Show file tree
Hide file tree
Showing 4 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -141,7 +141,7 @@ ignore = [
]

# Assume Python 3.11
target-version = "py311"
target-version = "py310"
line-length = 88

# Don't automatically concatenate strings -- sometimes we forget a comma!
Expand Down
2 changes: 1 addition & 1 deletion src/ferc_xbrl_extractor/taxonomy.py
Original file line number Diff line number Diff line change
Expand Up @@ -296,5 +296,5 @@ def save_metadata(self, filename: Path):
metadata = {**duration_metadata, **instant_metadata}

# Write to JSON file
with Path.open(filename, "w") as f:
with Path(filename).open(mode="w") as f:
json.dump(metadata, f, indent=4)
2 changes: 1 addition & 1 deletion src/ferc_xbrl_extractor/xbrl.py
Original file line number Diff line number Diff line change
Expand Up @@ -271,7 +271,7 @@ def get_fact_tables(
)

# Write to JSON file
with Path.open(datapackage_path, "w") as f:
with Path(datapackage_path).open(mode="w") as f:
f.write(datapackage.json(by_alias=True))

return datapackage.get_fact_tables(filter_tables=filter_tables)
2 changes: 1 addition & 1 deletion tests/conftest.py
Original file line number Diff line number Diff line change
Expand Up @@ -133,7 +133,7 @@ def temp_file_filing(filing_data):
"""Create temporary file of filing data."""
with tempfile.TemporaryDirectory() as tmpdir:
file_path = f"{tmpdir}/test.xbrl"
with Path.open(file_path, "w") as f:
with Path(file_path).open(mode="w") as f:
f.write(filing_data)

yield file_path
Expand Down

0 comments on commit ac28bf5

Please sign in to comment.