From 997640da5d1c7a83185e5d1174cfb642e7e46888 Mon Sep 17 00:00:00 2001 From: Pradyun Gedam Date: Sat, 14 Jan 2023 11:53:32 +0000 Subject: [PATCH] Import underlying parser function as an underscored variable This function is not a part of the public interface for this module. --- src/packaging/requirements.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/packaging/requirements.py b/src/packaging/requirements.py index a9f9b9c7..f34bfa85 100644 --- a/src/packaging/requirements.py +++ b/src/packaging/requirements.py @@ -5,7 +5,7 @@ import urllib.parse from typing import Any, List, Optional, Set -from ._parser import parse_requirement +from ._parser import parse_requirement as _parse_requirement from ._tokenizer import ParserSyntaxError from .markers import Marker, _normalize_extra_values from .specifiers import SpecifierSet @@ -32,7 +32,7 @@ class Requirement: def __init__(self, requirement_string: str) -> None: try: - parsed = parse_requirement(requirement_string) + parsed = _parse_requirement(requirement_string) except ParserSyntaxError as e: raise InvalidRequirement(str(e)) from e