From 67f46604dd4adaf83076f47438a3be1aff859327 Mon Sep 17 00:00:00 2001 From: Yuri Baburov Date: Sun, 2 Aug 2020 03:10:28 +0700 Subject: [PATCH] A fix for mac version test. --- Makefile | 3 +-- setup.py | 4 ++-- 2 files changed, 3 insertions(+), 4 deletions(-) diff --git a/Makefile b/Makefile index 2c1b765..012e4b7 100644 --- a/Makefile +++ b/Makefile @@ -27,7 +27,7 @@ setup: venv $(PIP) install -r requirements-dev.txt .venv/bin/python: - virtualenv .venv + test -d .venv || which python3 && python3 -m venv .venv || virtualenv .venv .PHONY: clean clean: @@ -45,7 +45,6 @@ develop: .venv/lib/python*/site-packages/readability-lxml.egg-link .PHONY: clean_all clean_all: clean_venv - # ########### # Deploy # ########### diff --git a/setup.py b/setup.py index da90e87..db43457 100755 --- a/setup.py +++ b/setup.py @@ -12,8 +12,8 @@ if sys.platform == "darwin": import platform mac_ver = platform.mac_ver()[0] - mac_ver_no = int(mac_ver.split(".")[1]) - if mac_ver_no < 9: + mac_major, mac_minor = mac_ver.split('.')[:2] + if int(mac_major) == 10 and int(mac_minor) < 9: print("Using lxml<2.4") lxml_requirement = "lxml<2.4"