File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 1313import io # don't use `codecs` for loading the DB; it will split lines on some IRC formatting
1414import logging
1515import os
16+ import sys
1617import threading
1718import time
1819import unicodedata
2223from sopel .tools .time import format_time , get_timezone
2324
2425
26+ if sys .version_info .major >= 3 :
27+ unicode = str
28+
29+
2530LOGGER = logging .getLogger (__name__ )
2631
2732
@@ -141,7 +146,7 @@ def _format_safe_lstrip(text):
141146 Stolen and tweaked from the ``choose`` plugin's ``_format_safe()``
142147 function by the person who wrote it.
143148 """
144- if not isinstance (text , str ):
149+ if not isinstance (text , unicode ):
145150 raise TypeError ("A string is required." )
146151 elif not text :
147152 # unnecessary optimization
Original file line number Diff line number Diff line change 55import datetime
66import io
77import os
8+ import sys
89
910import pytest
1011
1112from sopel import formatting
1213from sopel .modules import tell
1314
1415
16+ if sys .version_info .major >= 3 :
17+ unicode = str
18+
19+
1520def test_load_reminders_empty (tmpdir ):
1621 tmpfile = tmpdir .join ('tell.db' )
1722 tmpfile .write ('\n ' )
You can’t perform that action at this time.
0 commit comments