Skip to content

Commit

Permalink
fix: use sys.version_info
Browse files Browse the repository at this point in the history
Signed-off-by: Henry Schreiner <[email protected]>
  • Loading branch information
henryiii committed Oct 24, 2024
1 parent 1c12f12 commit 3a1a26a
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/packaging/metadata.py
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
from __future__ import annotations

import builtins
import email.feedparser
import email.header
import email.message
import email.parser
import email.policy
import pathlib
import sys
import typing
from typing import (
Any,
Expand All @@ -24,7 +24,7 @@
T = typing.TypeVar("T")


if "ExceptionGroup" not in builtins.__dict__: # pragma: no cover
if sys.version_info < (3, 11):

class ExceptionGroup(Exception):
"""A minimal implementation of :external:exc:`ExceptionGroup` from Python 3.11.
Expand All @@ -43,7 +43,7 @@ def __init__(self, message: str, exceptions: list[Exception]) -> None:
def __repr__(self) -> str:
return f"{self.__class__.__name__}({self.message!r}, {self.exceptions!r})"
else: # pragma: no cover
ExceptionGroup = builtins.ExceptionGroup # type: ignore[assignment, misc]
from builtins import ExceptionGroup


class InvalidMetadata(ValueError):
Expand Down

0 comments on commit 3a1a26a

Please sign in to comment.