From 0234178fb9ea5d5e7b00a2341815fdf98f3f125a Mon Sep 17 00:00:00 2001 From: Ethan <118581835+realethanhsu@users.noreply.github.com> Date: Thu, 28 Nov 2024 09:54:03 +0000 Subject: [PATCH] avoid some common manual error when set in python application. --- unstructured/utils.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/unstructured/utils.py b/unstructured/utils.py index 523fcd4a01..c878ae5d4c 100644 --- a/unstructured/utils.py +++ b/unstructured/utils.py @@ -278,7 +278,9 @@ def scarf_analytics(): python_version = ".".join(platform.python_version().split(".")[:2]) try: - if os.getenv("SCARF_NO_ANALYTICS") != "true" and os.getenv("DO_NOT_TRACK") != "true": + scarf_no_analytics = os.getenv("SCARF_NO_ANALYTICS", "").lower() + do_not_track = os.getenv("DO_NOT_TRACK", "").lower() + if scarf_no_analytics != "true" and do_not_track != "true": if "dev" in __version__: requests.get( "https://packages.unstructured.io/python-telemetry?version="