From 1604cb3dca9384683000ceaf39219867c1bf367c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tim=20R=C3=BChsen?= Date: Fri, 1 Jan 2016 22:32:11 +0100 Subject: [PATCH] Fix make_dafsa.py to generate 4 bit return values --- src/make_dafsa.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/make_dafsa.py b/src/make_dafsa.py index 0456191..bb308f6 100755 --- a/src/make_dafsa.py +++ b/src/make_dafsa.py @@ -211,7 +211,7 @@ def to_dafsa(words): if not 0x1F < ord(word[0]) < 0x80: raise InputError('Domain names must be printable 7-bit ASCII') if len(word) == 1: - return chr(ord(word[0]) & 0x0F), [None] + return chr(int(word[0], 16) & 0x0F), [None] return word[0], [to_nodes(word[1:])] return [to_nodes(word) for word in words]