Skip to content

Commit 613a1b7

Browse files
committed
Fixed a sys.platform check
So it turns out that on Linux, it sys.platform is "linux2" in Python 2 and "linux" in Python 3, so if doing a comparsion, need to do a .startswith() instead of a ==
1 parent 959aeed commit 613a1b7

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

cmd2.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -305,7 +305,7 @@ def new_func(instance, arg):
305305

306306
# Can we access the clipboard, always true on Windows and Mac, but only sometimes on Linux
307307
can_clip = True
308-
if sys.platform == 'linux':
308+
if sys.platform.startswith('linux'):
309309
try:
310310
pyperclip.paste()
311311
except pyperclip.exceptions.PyperclipException:

0 commit comments

Comments
 (0)