diff options
author | John Ehresman <jpe@wingware.com> | 2010-04-15 18:08:38 -0400 |
---|---|---|
committer | David Malcolm <dmalcolm@redhat.com> | 2010-04-16 13:02:42 -0400 |
commit | afb29c85fac4740a18ca67add8fee31a93e30739 (patch) | |
tree | fdea4e0f157763783bbbef162e33308bf5a2add6 /tests | |
parent | c2327f2d474f6311dab4a1ff85ddc91601941082 (diff) | |
download | pygobject-afb29c85fac4740a18ca67add8fee31a93e30739.tar.gz pygobject-afb29c85fac4740a18ca67add8fee31a93e30739.tar.xz pygobject-afb29c85fac4740a18ca67add8fee31a93e30739.zip |
A working _bytes for python 3k
Diffstat (limited to 'tests')
-rw-r--r-- | tests/common.py | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/tests/common.py b/tests/common.py index bd7951c..5222230 100644 --- a/tests/common.py +++ b/tests/common.py @@ -49,9 +49,10 @@ def importModule(module, directory, name=None): module, expected, current)) return obj -try: - _bytes = bytes -except NameError: +if sys.version_info >= (3, 0): + def _bytes(s): + return s.encode('latin1') +else: _bytes = str try: |