15
0
Files
python-gsm0338/no-six.patch
Matej Cepl 602026344c - Update to 1.1.0
* Document parameter and return types
  * fix formatting according flake8
  * add python 3.6 to test matrix
  * ignore .pytest_cache
  * use unicodedata python standard module to replace unicode.py
  * update referece to latest TS 23.038 standard
  * cleanup module public interface
  * remove *.txt from package_data
  * remove dependency to module six
  * add badges for PyPI and license
  * fix PyPI batch
  * add passenv to tox configuration to support codecov.io
  * use codecov python script
  * use Codec Error Handling Callbacks as described in PEP 293
  * bump version to 1.1.0
  * remove support for deprecated Python version 3.3
  * remove travis build for deprecated Python version 3.3
  * move input length calculation out of loop
  * format file according PEP8
  * collect coverage data
  * add space
  * move requirement pytest-cov from tox.ini into .travis.yml
  * use explicite list of deps in tox.ini
  * tox.ini deps update
  * cleanup setup, travis and tox configuration
  * fix type in codecov badge path
  * cleanup code registry
  * properly handle str and bytes replacement
  * Test and indicate support of Python 3.7

OBS-URL: https://build.opensuse.org/package/show/devel:languages:python/python-gsm0338?expand=0&rev=8
2025-11-29 22:13:33 +00:00

81 lines
2.7 KiB
Diff

Index: gsm0338-1.0.0/gsm0338/codec.py
===================================================================
--- gsm0338-1.0.0.orig/gsm0338/codec.py
+++ gsm0338-1.0.0/gsm0338/codec.py
@@ -1,5 +1,4 @@
import codecs
-from six import byte2int, int2byte, unichr
from .charset import BASIC_CHARACTER_SET, BASIC_CHARACTER_SET_EXTENSION
# Codec APIs
@@ -50,8 +49,8 @@ class Codec(codecs.Codec):
(self.NAME, character, consumed - 1))
if num is not None:
if num & 0xff00:
- encode_buffer += int2byte(self._ESCAPE)
- encode_buffer += int2byte(num & 0xff)
+ encode_buffer += bytes((self._ESCAPE,))
+ encode_buffer += bytes((num & 0xff,))
return encode_buffer, consumed
def decode(self, input, errors='strict'):
@@ -67,12 +66,12 @@ class Codec(codecs.Codec):
num = 0
for value in input:
consumed += 1
- num |= byte2int([value])
+ num |= [value][0]
if num == self._ESCAPE:
num <<= 8
continue
try:
- decode_buffer += unichr(self._decode_map[num])
+ decode_buffer += chr(self._decode_map[num])
except KeyError as ex:
if errors == 'replace':
decode_buffer += u'\ufffd'
Index: gsm0338-1.0.0/requirements.txt
===================================================================
--- gsm0338-1.0.0.orig/requirements.txt
+++ gsm0338-1.0.0/requirements.txt
@@ -1,3 +1,2 @@
-six
pytest
pytest-flake8
Index: gsm0338-1.0.0/setup.py
===================================================================
--- gsm0338-1.0.0.orig/setup.py
+++ gsm0338-1.0.0/setup.py
@@ -34,7 +34,7 @@ setup(
long_description=long_description,
packages=find_packages(),
- install_requires=['six'],
+ install_requires=[],
package_data={
'': ['*.txt', '*.rst'],
},
Index: gsm0338-1.0.0/test/test_codec.py
===================================================================
--- gsm0338-1.0.0.orig/test/test_codec.py
+++ gsm0338-1.0.0/test/test_codec.py
@@ -2,7 +2,6 @@
import gsm0338
import pytest
-from six import int2byte
@pytest.fixture
@@ -10,8 +9,8 @@ def codec():
return gsm0338.Codec()
-GSM_BASIC_CHARACTER_SET = b"".join([int2byte(x) for x in range(27)]) +\
- b"".join([int2byte(x) for x in range(28, 128)]) +\
+GSM_BASIC_CHARACTER_SET = b"".join([bytes(range(27))]) +\
+ b"".join([bytes(range(28, 128))]) +\
b"\x1B\x0A\x1B\x14\x1B\x28\x1B\x29\x1B\x2F"\
b"\x1B\x3C\x1B\x3D\x1B\x3E\x1B\x40\x1B\x65"
UNICODE_BASIC_CHARACTER_SET = u"@£$¥èéùìòÇ\nØø\rÅåΔ_ΦΓΛΩΠΨΣΘΞÆæßÉ" \