Project not found: devel:openQA:GitHub:os-autoinst:openQA:PR-6810

File 0001-742-drop-future-744.patch of Package python-canmatrix

From 0804d9b0eb363d91333ba8d10e01d475772b9375 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Eduard=20Br=C3=B6cker?= <eduard@gmx.de>
Date: Mon, 18 Dec 2023 08:42:18 +0100
Subject: [PATCH] #742 drop future (#744)

---
 setup.py                      | 1 -
 src/canmatrix/canmatrix.py    | 3 +--
 src/canmatrix/formats/sym.py  | 6 +-----
 src/canmatrix/formats/xls.py  | 3 +--
 src/canmatrix/formats/yaml.py | 5 +----
 6 files changed, 5 insertions(+), 15 deletions(-)

diff --git a/setup.py b/setup.py
index 56d9693..b8d1a3f 100644
--- a/setup.py
+++ b/setup.py
@@ -95,7 +95,6 @@ setup(
         "attrs>=19.2.0",
         "click",
         "enum34; python_version < '3.4'",
-        "future",
         "importlib-metadata; python_version < '3.8'",
         "six",
         "typing; python_version < '3.5'",
diff --git a/src/canmatrix/canmatrix.py b/src/canmatrix/canmatrix.py
index ac80a9f..98d5f2a 100644
--- a/src/canmatrix/canmatrix.py
+++ b/src/canmatrix/canmatrix.py
@@ -40,7 +40,6 @@ import warnings
 from builtins import *
 
 import attr
-from past.builtins import basestring
 from six.moves import zip_longest
 
 import canmatrix.copy
@@ -432,7 +431,7 @@ class Signal(object):
             if not (self.min <= value <= self.max):
                 value = self.min
 
-        if isinstance(value, basestring):
+        if isinstance(value, str):
             for value_key, value_string in self.values.items():
                 if value_string == value:
                     value = value_key
diff --git a/src/canmatrix/formats/sym.py b/src/canmatrix/formats/sym.py
index e7b669f..60baa48 100644
--- a/src/canmatrix/formats/sym.py
+++ b/src/canmatrix/formats/sym.py
@@ -100,11 +100,7 @@ def format_float(f):  # type: (typing.Any) -> str
 
 def create_signal(db, signal):  # type: (canmatrix.CanMatrix, canmatrix.Signal) -> str
     output = ""
-    if sys.version_info > (3, 0):
-        quote_name = not signal.name.isidentifier()
-    else:
-        from future.utils import isidentifier
-        quote_name = not isidentifier(signal.name)
+    quote_name = not signal.name.isidentifier()
     if quote_name:
         output += 'Var="%s" ' % signal.name
     else:
diff --git a/src/canmatrix/formats/xls.py b/src/canmatrix/formats/xls.py
index 011fbe0..e9a7612 100644
--- a/src/canmatrix/formats/xls.py
+++ b/src/canmatrix/formats/xls.py
@@ -30,7 +30,6 @@ import logging
 import typing
 from builtins import *
 
-import past.builtins
 import xlrd
 import xlwt
 
@@ -540,7 +539,7 @@ def load(file, **options):
         unit = ""
 
         factor = sh.cell(row_num, index['function']).value
-        if isinstance(factor, past.builtins.basestring):
+        if isinstance(factor, str):
             factor = factor.strip()
             if " " in factor and factor[0].isdigit():
                 (factor, unit) = factor.strip().split(" ", 1)
diff --git a/src/canmatrix/formats/yaml.py b/src/canmatrix/formats/yaml.py
index 972c7f6..0cb656b 100644
--- a/src/canmatrix/formats/yaml.py
+++ b/src/canmatrix/formats/yaml.py
@@ -30,7 +30,6 @@ import typing
 from builtins import *
 
 import yaml
-from past.builtins import long, unicode
 
 import canmatrix
 
@@ -43,8 +42,6 @@ except ImportError:
 representers = False
 try:
     yaml.add_representer(int, SafeRepresenter.represent_int)
-    yaml.add_representer(long, SafeRepresenter.represent_long)
-    yaml.add_representer(unicode, SafeRepresenter.represent_unicode)
     yaml.add_representer(str, SafeRepresenter.represent_unicode)
     yaml.add_representer(list, SafeRepresenter.represent_list)
     representers = True
@@ -67,7 +64,7 @@ def dump(db, f, **options):  # type: (canmatrix.CanMatrix, typing.IO, **typing.A
 
     # f = open(filename, "w")
     if representers:
-        f.write(unicode(yaml.dump(new_db)))
+        f.write(yaml.dump(new_db))
     else:
         f.write(yaml.dump(new_db).encode('utf8'))
 
-- 
2.47.0

openSUSE Build Service is sponsored by