Skip to content

Commit c5c7b7d

Browse files
committed
Drop Python 2 Unicode handling
1 parent 31f1975 commit c5c7b7d

File tree

2 files changed

+0
-24
lines changed

2 files changed

+0
-24
lines changed

bagit.py

Lines changed: 0 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1438,19 +1438,6 @@ def _decode_filename(s):
14381438
return s
14391439

14401440

1441-
def force_unicode_py2(s):
1442-
"""Reliably return a Unicode string given a possible unicode or byte string"""
1443-
if isinstance(s, str):
1444-
return s.decode("utf-8")
1445-
else:
1446-
return unicode(s)
1447-
1448-
1449-
if sys.version_info > (3, 0):
1450-
force_unicode = str
1451-
else:
1452-
force_unicode = force_unicode_py2
1453-
14541441
# following code is used for command line program
14551442

14561443

test.py

Lines changed: 0 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1285,16 +1285,5 @@ def test_create_bag(self):
12851285
self.assertEqual(cm.exception.code, 0)
12861286

12871287

1288-
class TestUtils(unittest.TestCase):
1289-
def test_force_unicode_str_to_unicode(self):
1290-
self.assertIsInstance(bagit.force_unicode("foobar"), str)
1291-
1292-
def test_force_unicode_pass_through(self):
1293-
self.assertIsInstance(bagit.force_unicode("foobar"), str)
1294-
1295-
def test_force_unicode_int(self):
1296-
self.assertIsInstance(bagit.force_unicode(1234), str)
1297-
1298-
12991288
if __name__ == "__main__":
13001289
unittest.main()

0 commit comments

Comments
 (0)