Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

distutils is removed in Python 3.12 #137

Open
clauseggers opened this issue Dec 13, 2023 · 2 comments
Open

distutils is removed in Python 3.12 #137

clauseggers opened this issue Dec 13, 2023 · 2 comments

Comments

@clauseggers
Copy link

As per https://docs.python.org/3.12/whatsnew/3.12.html distutils is removed from Python 3.12
Of note, the distutils package has been removed from the standard library.

Executing sncli now throws ModuleNotFoundError: No module named 'distutils'

@N0ury
Copy link

N0ury commented Mar 30, 2024

Hi,

Here's how I've solved this issue in simplenote_cli/clipboard.py

@@ -1,5 +1,5 @@
 import os
-from distutils import spawn
+from shutil import which
 from subprocess import Popen, PIPE
 
 
@@ -8,9 +8,9 @@
         self.copy_command = self.get_copy_command()
 
     def get_copy_command(self):
-        if (spawn.find_executable('xsel')):
+        if (which('xsel')):
             return ['xsel', '-ib']
-        if (spawn.find_executable('pbcopy')):
+        if (which('pbcopy')):
             return ['pbcopy']
         return None

@N0ury
Copy link

N0ury commented Aug 4, 2024

Closed with this commit

@clauseggers please close the issue

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants