Skip to content

Commit d6549c8

Browse files
authored
Merge pull request #761 from python-cmd2/pyperclip_wsl
Fixed a bug when using WSL when all Windows paths have been removed
2 parents 5643d56 + ee570ec commit d6549c8

File tree

2 files changed

+4
-1
lines changed

2 files changed

+4
-1
lines changed

CHANGELOG.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,6 @@
11
## 0.9.17 (TBD, 2019)
2+
* Bug Fixes
3+
* Fixed a bug when using WSL when all Windows paths have been removed from $PATH
24
* Enhancements
35
* No longer treating empty text scripts as an error condition
46

cmd2/clipboard.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,8 @@
1010
try:
1111
# Try getting the contents of the clipboard
1212
_ = pyperclip.paste()
13-
except PyperclipException:
13+
except (PyperclipException, FileNotFoundError):
14+
# NOTE: FileNotFoundError is for Windows Subsystem for Linux (WSL) when Windows paths are removed from $PATH
1415
can_clip = False
1516
else:
1617
can_clip = True

0 commit comments

Comments
 (0)