Skip to content

Commit 36b2af9

Browse files
Changed gradio version check from print statement to warning (#8609)
* changed print statement to warning * Updated warnings in single line * add changeset --------- Co-authored-by: gradio-pr-bot <[email protected]>
1 parent c7cd0a0 commit 36b2af9

File tree

2 files changed

+8
-3
lines changed

2 files changed

+8
-3
lines changed

.changeset/fifty-books-fly.md

+5
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
"gradio": patch
3+
---
4+
5+
feat:Changed gradio version check from print statement to warning

gradio/analytics.py

+3-3
Original file line numberDiff line numberDiff line change
@@ -103,11 +103,11 @@ def version_check():
103103
current_pkg_version = get_package_version()
104104
latest_pkg_version = httpx.get(url=PKG_VERSION_URL, timeout=3).json()["version"]
105105
if Version(latest_pkg_version) > Version(current_pkg_version):
106-
print(
106+
warnings.warn(
107107
f"IMPORTANT: You are using gradio version {current_pkg_version}, "
108-
f"however version {latest_pkg_version} is available, please upgrade."
108+
f"however version {latest_pkg_version} is available, please upgrade. \n"
109+
f"--------"
109110
)
110-
print("--------")
111111
except json.decoder.JSONDecodeError:
112112
warnings.warn("unable to parse version details from package URL.")
113113
except KeyError:

0 commit comments

Comments
 (0)