diff --git a/frappe/testing/environment.py b/frappe/testing/environment.py index b94925878b..2ea3cfc381 100644 --- a/frappe/testing/environment.py +++ b/frappe/testing/environment.py @@ -25,7 +25,7 @@ import logging import pkgutil import unittest -import tomllib +import tomli import frappe import frappe.utils.scheduler @@ -91,7 +91,7 @@ def _decorate_all_methods_and_functions_with_type_checker(): def _get_config_from_pyproject(app_path): try: with open(f"{app_path}/pyproject.toml", "rb") as f: - config = tomllib.load(f) + config = tomli.load(f) return ( config.get("tool", {}) .get("frappe", {}) @@ -100,7 +100,7 @@ def _decorate_all_methods_and_functions_with_type_checker(): ) except FileNotFoundError: return {} - except tomllib.TOMLDecodeError: + except tomli.TOMLDecodeError: logger.warning(f"Failed to parse pyproject.toml for app {app_path}") return {} diff --git a/frappe/www/attribution.py b/frappe/www/attribution.py index 65c4cdedca..eb46e910a9 100644 --- a/frappe/www/attribution.py +++ b/frappe/www/attribution.py @@ -2,7 +2,7 @@ import json import re from pathlib import Path -import tomllib +import tomli import frappe from frappe import _ @@ -58,7 +58,7 @@ def get_pyproject_info(app: str) -> dict: return {} with open(pyproject_toml, "rb") as f: - pyproject = tomllib.load(f) + pyproject = tomli.load(f) return pyproject.get("project", {})