Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 44b86cf

Browse files
committed
Add six to the requirements, use it's text_type
1 parent 11850ff commit 44b86cf

2 files changed

Lines changed: 10 additions & 7 deletions

File tree

bidi/algorithm.py

Lines changed: 9 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -16,12 +16,15 @@
1616
# Copyright (C) 2008-2010 Yaacov Zamir <kzamir_a_walla.co.il>,
1717
# Meir kriheli <[email protected]>
1818
"bidirectional alogrithm implementation"
19+
import sys
1920

20-
from unicodedata import bidirectional, mirrored
2121
import inspect
22-
import sys
2322
from collections import deque
24-
from mirror import MIRRORED
23+
from unicodedata import bidirectional, mirrored
24+
import six
25+
26+
from .mirror import MIRRORED
27+
2528

2629
# Some definitions
2730
PARAGRAPH_LEVELS = { 'L':0, 'AL':1, 'R': 1 }
@@ -38,8 +41,8 @@
3841
}
3942

4043
# Added 'B' so X6 won't execute in that case and X8 will run it's course
41-
X6_IGNORED = X2_X5_MAPPINGS.keys() + ['BN', 'PDF', 'B']
42-
X9_REMOVED = X2_X5_MAPPINGS.keys() + ['BN', 'PDF']
44+
X6_IGNORED = list(X2_X5_MAPPINGS.keys()) + ['BN', 'PDF', 'B']
45+
X9_REMOVED = list(X2_X5_MAPPINGS.keys()) + ['BN', 'PDF']
4346

4447
_embedding_direction = lambda x:('L', 'R')[x % 2]
4548

@@ -597,7 +600,7 @@ def get_display(unicode_or_str, encoding='utf-8', upper_is_rtl=False,
597600
storage = get_empty_storage()
598601

599602
# utf-8 ? we need unicode
600-
if isinstance(unicode_or_str, unicode):
603+
if isinstance(unicode_or_str, six.string_types):
601604
text = unicode_or_str
602605
decoded = False
603606
else:

setup.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
history = open('HISTORY.rst').read().replace('.. :changelog:', '')
1212

1313
requirements = [
14-
# TODO: put package requirements here
14+
'six'
1515
]
1616

1717
test_requirements = [

0 commit comments

Comments
 (0)