From 15cd7fa067e68a4b4d2ba7989efa3deab5ce0e10 Mon Sep 17 00:00:00 2001 From: Zac Medico Date: Sat, 4 Aug 2012 12:26:25 -0700 Subject: WhirlpoolAdd: raise TypeError if not bytes --- pym/portage/util/whirlpool.py | 2 ++ 1 file changed, 2 insertions(+) (limited to 'pym') diff --git a/pym/portage/util/whirlpool.py b/pym/portage/util/whirlpool.py index c696f6fc0..170ae73f8 100644 --- a/pym/portage/util/whirlpool.py +++ b/pym/portage/util/whirlpool.py @@ -639,6 +639,8 @@ def WhirlpoolInit(ctx): return def WhirlpoolAdd(source, sourceBits, ctx): + if not isinstance(source, bytes): + raise TypeError("Expected %s, got %s" % (bytes, type(source))) if sys.hexversion < 0x3000000: source = [ord(s)&0xff for s in source] -- cgit v1.2.3-65-gdbad