forked from pool/python-python-editor
Accepting request 1287206 from home:nkrapp:branches:devel:languages:python
- Add support-python312.patch to not depend on distutils (boo#1245108) - clean up duplicate files OBS-URL: https://build.opensuse.org/request/show/1287206 OBS-URL: https://build.opensuse.org/package/show/devel:languages:python/python-python-editor?expand=0&rev=20
This commit is contained in:
33
support-python312.patch
Normal file
33
support-python312.patch
Normal file
@@ -0,0 +1,33 @@
|
||||
From 5023fafd265add111b29baca59b07f140daf75b7 Mon Sep 17 00:00:00 2001
|
||||
From: Branch Vincent <branchevincent@gmail.com>
|
||||
Date: Sun, 8 Oct 2023 12:52:53 -0700
|
||||
Subject: [PATCH] support python 3.12
|
||||
|
||||
Python 3.12 has removed `distutils`: https://docs.python.org/3.12/whatsnew/3.12.html#removed
|
||||
---
|
||||
editor.py | 5 ++++-
|
||||
1 file changed, 4 insertions(+), 1 deletion(-)
|
||||
|
||||
Index: python-editor-1.0.4/editor.py
|
||||
===================================================================
|
||||
--- python-editor-1.0.4.orig/editor.py
|
||||
+++ python-editor-1.0.4/editor.py
|
||||
@@ -8,7 +8,6 @@ import locale
|
||||
import os.path
|
||||
import subprocess
|
||||
import tempfile
|
||||
-from distutils.spawn import find_executable
|
||||
|
||||
|
||||
__all__ = [
|
||||
@@ -52,6 +51,10 @@ def get_editor_args(editor):
|
||||
|
||||
|
||||
def get_editor():
|
||||
+ try:
|
||||
+ from distutils.spawn import find_executable
|
||||
+ except ImportError:
|
||||
+ from shutil import which as find_executable
|
||||
# Get the editor from the environment. Prefer VISUAL to EDITOR
|
||||
editor = os.environ.get('VISUAL') or os.environ.get('EDITOR')
|
||||
if editor:
|
Reference in New Issue
Block a user