summaryrefslogtreecommitdiffstats
path: root/tests/common.py
diff options
context:
space:
mode:
authorJohn Ehresman <jpe@wingware.com>2010-04-16 11:55:50 -0400
committerDavid Malcolm <dmalcolm@redhat.com>2010-04-16 13:02:42 -0400
commitcecafa7e4809c8c2bfa77446beea8beb3a51d8dc (patch)
tree00d4bb95a55f3e55dc4c0d453f75011852667405 /tests/common.py
parentbe40a7e479e12e6c5f15603c134c926ac300ba7b (diff)
downloadpygobject-cecafa7e4809c8c2bfa77446beea8beb3a51d8dc.tar.gz
pygobject-cecafa7e4809c8c2bfa77446beea8beb3a51d8dc.tar.xz
pygobject-cecafa7e4809c8c2bfa77446beea8beb3a51d8dc.zip
Test fixes for bytes
Diffstat (limited to 'tests/common.py')
-rw-r--r--tests/common.py5
1 files changed, 4 insertions, 1 deletions
diff --git a/tests/common.py b/tests/common.py
index 5222230..b5f5bfc 100644
--- a/tests/common.py
+++ b/tests/common.py
@@ -51,7 +51,10 @@ def importModule(module, directory, name=None):
if sys.version_info >= (3, 0):
def _bytes(s):
- return s.encode('latin1')
+ if isinstance(s, str):
+ return s.encode('latin1')
+ else:
+ return bytes(s)
else:
_bytes = str