Fullscreen eingestellt.

This commit is contained in:
2024-07-15 11:01:34 +02:00
parent 0c4926f0d5
commit a7955bc775
811 changed files with 9453 additions and 60540 deletions

View File

@@ -1,9 +1,11 @@
"""Stuff that differs in different Python versions and platform
distributions."""
import importlib.resources
import logging
import os
import sys
from typing import IO
__all__ = ["get_path_uid", "stdlib_pkgs", "WINDOWS"]
@@ -51,6 +53,20 @@ def get_path_uid(path: str) -> int:
return file_uid
# The importlib.resources.open_text function was deprecated in 3.11 with suggested
# replacement we use below.
if sys.version_info < (3, 11):
open_text_resource = importlib.resources.open_text
else:
def open_text_resource(
package: str, resource: str, encoding: str = "utf-8", errors: str = "strict"
) -> IO[str]:
return (importlib.resources.files(package) / resource).open(
"r", encoding=encoding, errors=errors
)
# packages in the stdlib that may have installation metadata, but should not be
# considered 'installed'. this theoretically could be determined based on
# dist.location (py27:`sysconfig.get_paths()['stdlib']`,