Skip to content

Commit ae54f68

Browse files
committed
use Internet check from penv_setup.py
1 parent 9a3d554 commit ae54f68

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

platform.py

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -53,6 +53,7 @@
5353

5454
setup_penv_minimal = penv_setup_module.setup_penv_minimal
5555
get_executable_path = penv_setup_module.get_executable_path
56+
has_internet_connection = penv_setup_module.has_internet_connection
5657

5758

5859
# Constants
@@ -121,12 +122,11 @@
121122
logger = logging.getLogger(__name__)
122123

123124
def is_internet_available():
124-
"""Check if connected to Internet"""
125-
try:
126-
with socket.create_connection(("8.8.8.8", 53), timeout=3):
127-
return True
128-
except OSError:
129-
return False
125+
"""
126+
Check if connected to Internet.
127+
Uses the centralized internet check from penv_setup module.
128+
"""
129+
return has_internet_connection()
130130

131131
def safe_file_operation(operation_func):
132132
"""Decorator for safe filesystem operations with error handling."""

0 commit comments

Comments
 (0)