14
0
forked from pool/python-ssdeep
Files
python-ssdeep/python-ssdeep-no-six.patch
Markéta Machová 0a2896f0df Accepting request 1035250 from home:pgajdos:python
- silent rpmlint

- version update to 3.4.1
  * Add internal build improvements
  * Update CI pipelines
- do not require python-six
- added patches
  fix 6cf96d63e9
  + python-ssdeep-no-six.patch

OBS-URL: https://build.opensuse.org/request/show/1035250
OBS-URL: https://build.opensuse.org/package/show/devel:languages:python/python-ssdeep?expand=0&rev=15
2022-11-11 13:42:27 +00:00

93 lines
2.7 KiB
Diff

diff --git a/setup.py b/setup.py
index 3a32b13..c99d33d 100755
--- a/setup.py
+++ b/setup.py
@@ -182,11 +182,9 @@ def get_objects():
keywords="ssdeep",
install_requires=[
"cffi>=1.0.0",
- "six>=1.4.1",
],
setup_requires=[
"cffi>=1.0.0",
- "six>=1.4.1",
] + setup_requires,
tests_require=[
"pytest",
diff --git a/src/ssdeep/__init__.py b/src/ssdeep/__init__.py
index 5735d51..7aaf884 100644
--- a/src/ssdeep/__init__.py
+++ b/src/ssdeep/__init__.py
@@ -5,8 +5,6 @@
import os
-import six
-
# Ignore flake8 F401 warning for unused vars
from ssdeep.__about__ import ( # noqa: F401
__author__, __copyright__, __email__, __license__, __summary__, __title__,
@@ -104,10 +102,10 @@ def update(self, buf, encoding="utf-8"):
if self._state == ffi.NULL:
raise InternalError("State object is NULL")
- if isinstance(buf, six.text_type):
+ if isinstance(buf, str):
buf = buf.encode(encoding)
- if not isinstance(buf, six.binary_type):
+ if not isinstance(buf, bytes):
raise TypeError(
"Argument must be of string, unicode or bytes type not "
"'%r'" % type(buf)
@@ -179,10 +177,10 @@ def update(self, buf, encoding="utf-8"):
"""
- if isinstance(buf, six.text_type):
+ if isinstance(buf, str):
buf = buf.encode(encoding)
- if not isinstance(buf, six.binary_type):
+ if not isinstance(buf, bytes):
raise TypeError(
"Argument must be of string, unicode or bytes type not "
"'%r'" % type(buf)
@@ -222,18 +220,18 @@ def compare(sig1, sig2):
"""
- if isinstance(sig1, six.text_type):
+ if isinstance(sig1, str):
sig1 = sig1.encode("ascii")
- if isinstance(sig2, six.text_type):
+ if isinstance(sig2, str):
sig2 = sig2.encode("ascii")
- if not isinstance(sig1, six.binary_type):
+ if not isinstance(sig1, bytes):
raise TypeError(
"First argument must be of string, unicode or bytes type not "
"'%s'" % type(sig1)
)
- if not isinstance(sig2, six.binary_type):
+ if not isinstance(sig2, bytes):
raise TypeError(
"Second argument must be of string, unicode or bytes type not "
"'%r'" % type(sig2)
@@ -258,10 +256,10 @@ def hash(buf, encoding="utf-8"):
"""
- if isinstance(buf, six.text_type):
+ if isinstance(buf, str):
buf = buf.encode(encoding)
- if not isinstance(buf, six.binary_type):
+ if not isinstance(buf, bytes):
raise TypeError(
"Argument must be of string, unicode or bytes type not "
"'%r'" % type(buf)