ultralytics 8.1.37 fix empty sys.argv bug (#9390)

Signed-off-by: Glenn Jocher <glenn.jocher@ultralytics.com>
Co-authored-by: Joshua Harrison <108553645+TurbineJoshua@users.noreply.github.com>
Co-authored-by: Joshua Harrison <joshua@fido.investments>
Co-authored-by: UltralyticsAssistant <web@ultralytics.com>
This commit is contained in:
Glenn Jocher 2024-03-29 03:20:39 +01:00 committed by GitHub
parent ed2250cf1c
commit 4a7ccba0af
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
6 changed files with 31 additions and 15 deletions

View file

@ -3,7 +3,6 @@
import os
import platform
import random
import sys
import threading
import time
from pathlib import Path
@ -11,6 +10,7 @@ from pathlib import Path
import requests
from ultralytics.utils import (
ARGV,
ENVIRONMENT,
LOGGER,
ONLINE,
@ -188,7 +188,7 @@ class Events:
self.rate_limit = 60.0 # rate limit (seconds)
self.t = 0.0 # rate limit timer (seconds)
self.metadata = {
"cli": Path(sys.argv[0]).name == "yolo",
"cli": Path(ARGV[0]).name == "yolo",
"install": "git" if is_git_dir() else "pip" if is_pip_package() else "other",
"python": ".".join(platform.python_version_tuple()[:2]), # i.e. 3.10
"version": __version__,