summaryrefslogtreecommitdiffstats
path: root/tests
diff options
context:
space:
mode:
authorJohn Ehresman <jpe@wingware.com>2010-04-15 18:08:38 -0400
committerDavid Malcolm <dmalcolm@redhat.com>2010-04-16 13:02:42 -0400
commitafb29c85fac4740a18ca67add8fee31a93e30739 (patch)
treefdea4e0f157763783bbbef162e33308bf5a2add6 /tests
parentc2327f2d474f6311dab4a1ff85ddc91601941082 (diff)
downloadpygobject-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.py7
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: