Skip to content

Commit c7e4717

Browse files
authored
Merge pull request #141 from hroncok/python3.14
Don't use codecs.open on Python 3 in automatic tests
2 parents 57cfbda + ec2d19f commit c7e4717

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

tests/test_emojis.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
# std imports
22
import os
3-
import codecs
43

54
# 3rd party
65
import pytest
@@ -11,6 +10,8 @@
1110
except NameError:
1211
# python 3
1312
unichr = chr
13+
else:
14+
from codecs import open
1415

1516
# some tests cannot be done on some builds of python, where the internal
1617
# unicode structure is limited to 0x10000 for memory conservation,
@@ -146,7 +147,7 @@ def test_longer_emoji_zwj_sequence():
146147

147148

148149
def read_sequences_from_file(filename):
149-
fp = codecs.open(os.path.join(os.path.dirname(__file__), filename), 'r', encoding='utf-8')
150+
fp = open(os.path.join(os.path.dirname(__file__), filename), 'r', encoding='utf-8')
150151
lines = [line.strip()
151152
for line in fp.readlines()
152153
if not line.startswith('#') and line.strip()]

0 commit comments

Comments
 (0)