From: Zac Medico Date: Sat, 4 Aug 2012 19:26:25 +0000 (-0700) Subject: WhirlpoolAdd: raise TypeError if not bytes X-Git-Tag: v2.2.0_alpha121~12 X-Git-Url: http://git.tremily.us/?a=commitdiff_plain;h=15cd7fa067e68a4b4d2ba7989efa3deab5ce0e10;p=portage.git WhirlpoolAdd: raise TypeError if not bytes --- 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]