Skip to content

Commit 7929e89

Browse files
committed
patch wsl compatibility
Change wsl check to something more universal and consistent
1 parent f197ca5 commit 7929e89

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

pandas/io/clipboard/__init__.py

+3-3
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,7 @@
4545
import contextlib
4646
import ctypes
4747
from ctypes import c_size_t, c_wchar, c_wchar_p, get_errno, sizeof
48+
import distutils.spawn
4849
import os
4950
import platform
5051
import subprocess
@@ -521,9 +522,8 @@ def determine_clipboard():
521522
return init_windows_clipboard()
522523

523524
if platform.system() == "Linux":
524-
with open("/proc/version") as f:
525-
if "Microsoft" in f.read():
526-
return init_wsl_clipboard()
525+
if distutils.spawn.find_executable("wslconfig.exe"):
526+
return init_wsl_clipboard()
527527

528528
# Setup for the MAC OS X platform:
529529
if os.name == "mac" or platform.system() == "Darwin":

0 commit comments

Comments
 (0)