asweigart / pyperclip

Python module for cross-platform clipboard functions.
https://pypi.python.org/pypi/pyperclip
BSD 3-Clause "New" or "Revised" License
1.6k stars 193 forks source link

Please Consider Checking HAS_DISPLAY dynamically #236

Open mode9 opened 1 year ago

mode9 commented 1 year ago

HAS_DISPLAY is defined globally. https://github.com/asweigart/pyperclip/blob/781603ea491eefce3b58f4f203bf748dbf9ff003/src/pyperclip/__init__.py#L66

It means that pyperclip should always be imported dynamically after DISPLAY is changed. Checking DISPLAY when copy/paste called may be good enough.