|
3 | 3 | import json |
4 | 4 | import logging |
5 | 5 | import ctypes |
6 | | -import platform |
7 | 6 | import subprocess |
8 | 7 | import urllib.parse |
9 | 8 | from ...webview import Webview |
@@ -112,7 +111,7 @@ def webview_return(self, w, seq, status, result): |
112 | 111 |
|
113 | 112 | def webview_get_window(self, w): |
114 | 113 | # On Windows, returning the real HWND allows native features (Taskbar, Menus) to work. |
115 | | - if platform.system() == "Windows": |
| 114 | + if sys.platform == "win32": |
116 | 115 | return self.real_hwnd |
117 | 116 | return 0 |
118 | 117 |
|
@@ -319,22 +318,22 @@ def __init__(self, config): |
319 | 318 |
|
320 | 319 | # --- Platform Helpers (All Platforms) --- |
321 | 320 | self._platform = None |
322 | | - current_sys = platform.system() |
| 321 | + current_sys = sys.platform |
323 | 322 | try: |
324 | | - if current_sys == "Windows": |
| 323 | + if current_sys == "win32": |
325 | 324 | from ...platforms.windows import WindowsImplementation |
326 | 325 |
|
327 | 326 | self._platform = WindowsImplementation() |
328 | | - elif current_sys == "Darwin": |
| 327 | + elif current_sys == "darwin": |
329 | 328 | from ...platforms.darwin import DarwinImplementation |
330 | 329 |
|
331 | 330 | self._platform = DarwinImplementation() |
332 | | - elif current_sys == "Linux": |
| 331 | + elif current_sys == "linux": |
333 | 332 | from ...platforms.linux import LinuxImplementation |
334 | 333 |
|
335 | 334 | self._platform = LinuxImplementation() |
336 | 335 | except Exception as e: |
337 | | - self.logger.warning(f"Failed to load {current_sys} Platform helpers: {e}") |
| 336 | + self.logger.warning(f"Failed to load platform helpers: {e}") |
338 | 337 |
|
339 | 338 | # 7. JS Init Shim (With Proxy for Dynamic Methods) |
340 | 339 | init_js = f""" |
|
0 commit comments