Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 10 additions & 4 deletions src/pyperclip/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -600,7 +600,7 @@ def set_clipboard(clipboard):
copy, paste = clipboard_types[clipboard]()


def lazy_load_stub_copy(text):
def lazy_load_stub_copy(text, primary=False):
'''
A stub function for copy(), which will load the real copy() function when
called so that the real copy() function is used for later calls.
Expand All @@ -619,10 +619,13 @@ def lazy_load_stub_copy(text):
'''
global copy, paste
copy, paste = determine_clipboard()
return copy(text)
try:
return copy(text, primary=primary)
except TypeError:
return copy(text)


def lazy_load_stub_paste():
def lazy_load_stub_paste(primary=False):
'''
A stub function for paste(), which will load the real paste() function when
called so that the real paste() function is used for later calls.
Expand All @@ -641,7 +644,10 @@ def lazy_load_stub_paste():
'''
global copy, paste
copy, paste = determine_clipboard()
return paste()
try:
return paste(primary=primary)
except TypeError:
return paste()


def is_available():
Expand Down