1 diff --git a/README.md b/README.md
2 index 3714d29..efda4a5 100644
5 @@ -32,7 +32,6 @@ import sure
7 (4).should.be.equal(2 + 2)
8 (7.5).should.eql(3.5 + 4)
9 -(2).should.equal(8 / 4)
11 (3).shouldnt.be.equal(5)
13 diff --git a/setup.py b/setup.py
14 index a4877f6..778f8c8 100755
22 from setuptools import setup, find_packages
25 @@ -41,8 +42,10 @@ def read_version():
29 -local_file = lambda *f: \
30 - open(os.path.join(os.path.dirname(__file__), *f)).read()
32 + if sys.version_info < (3, 0, 0):
33 + return open(os.path.join(os.path.dirname(__file__), *f)).read()
34 + return open(os.path.join(os.path.dirname(__file__), *f), encoding="utf-8").read()
37 install_requires = ['mock', 'six']
38 diff --git a/sure/old.py b/sure/old.py
39 index 70822e1..13a3f74 100644
42 @@ -42,10 +42,10 @@ from sure.core import itemize_length
45 def identify_callable_location(callable_object):
46 - filename = os.path.relpath(callable_object.func_code.co_filename)
47 - lineno = callable_object.func_code.co_firstlineno
48 - callable_name = callable_object.func_code.co_name
49 - return b'{0} [{1} line {2}]'.format(callable_name, filename, lineno)
50 + filename = os.path.relpath(callable_object.__code__.co_filename)
51 + lineno = callable_object.__code__.co_firstlineno
52 + callable_name = callable_object.__code__.co_name
53 + return '{0} [{1} line {2}]'.format(callable_name, filename, lineno).encode()
57 diff --git a/tests/test_assertion_builder.py b/tests/test_assertion_builder.py
58 index 3e1cd8e..7e833e6 100644
59 --- a/tests/test_assertion_builder.py
60 +++ b/tests/test_assertion_builder.py
61 @@ -648,13 +648,19 @@ def test_throw_matching_regex():
62 raise RuntimeError('should not have reached here')
64 except AssertionError as e:
65 - expect(str(e)).to.equal("When calling 'blah [tests/test_assertion_builder.py line 633]' the exception message does not match. Expected to match regex: u'invalid regex'\n against:\n u'this message'")
67 + expect(str(e)).to.equal("When calling b'blah [tests/test_assertion_builder.py line 633]' the exception message does not match. Expected to match regex: 'invalid regex'\n against:\n 'this message'")
69 + expect(str(e)).to.equal("When calling 'blah [tests/test_assertion_builder.py line 633]' the exception message does not match. Expected to match regex: u'invalid regex'\n against:\n u'this message'")
72 expect(blah).when.called_with(1).should.throw(ValueError, re.compile(r'invalid regex'))
73 raise RuntimeError('should not have reached here')
74 except AssertionError as e:
75 - expect(str(e)).to.equal("When calling 'blah [tests/test_assertion_builder.py line 633]' the exception message does not match. Expected to match regex: u'invalid regex'\n against:\n u'this message'")
77 + expect(str(e)).to.equal("When calling b'blah [tests/test_assertion_builder.py line 633]' the exception message does not match. Expected to match regex: 'invalid regex'\n against:\n 'this message'")
79 + expect(str(e)).to.equal("When calling 'blah [tests/test_assertion_builder.py line 633]' the exception message does not match. Expected to match regex: u'invalid regex'\n against:\n u'this message'")
81 def test_should_not_be_different():
82 ("'something'.should_not.be.different('SOMETHING'.lower())")