Commit aa1fee38 authored by Maurits van Rees's avatar Maurits van Rees Committed by Godefroid Chapelle

Fixed import of packaging.markers.

parent 7de68258
Fixed import of packaging.markers. [maurits]
...@@ -22,12 +22,12 @@ import textwrap ...@@ -22,12 +22,12 @@ import textwrap
import logging import logging
try: try:
import packaging from packaging import markers
except ImportError: except ImportError:
try: try:
from pip._vendor import packaging from pip._vendor.packaging import markers
except ImportError: except ImportError:
from pkg_resources import packaging from pkg_resources.packaging import markers
logger = logging.getLogger('zc.buildout') logger = logging.getLogger('zc.buildout')
...@@ -191,9 +191,9 @@ def parse(fp, fpname, exp_globals=dict): ...@@ -191,9 +191,9 @@ def parse(fp, fpname, exp_globals=dict):
try: try:
# new-style markers as used in pip constraints, e.g.: # new-style markers as used in pip constraints, e.g.:
# 'python_version < "3.11" and platform_system == "Windows"' # 'python_version < "3.11" and platform_system == "Windows"'
marker = packaging.markers.Marker(expr) marker = markers.Marker(expr)
section_condition = marker.evaluate() section_condition = marker.evaluate()
except packaging.markers.InvalidMarker: except markers.InvalidMarker:
# old style buildout expression # old style buildout expression
# rebuild a valid Python expression wrapped in a list # rebuild a valid Python expression wrapped in a list
expr = head + expr + tail expr = head + expr + tail
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment