From de2e190367e3b4ce34604646959695c0b7e2accb Mon Sep 17 00:00:00 2001 From: Elena ``of Valhalla'' Grandi Date: Thu, 16 Nov 2017 22:15:16 +0100 Subject: py3 encoding/str/bytes fixes --- namegen.py | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) (limited to 'namegen.py') diff --git a/namegen.py b/namegen.py index a07ca16..f7aa00f 100755 --- a/namegen.py +++ b/namegen.py @@ -96,7 +96,6 @@ class Stats: """Calculate stats from a list of names in a file-like object.""" for name in fp.readlines(): - name = name.decode('utf-8') for i in range(min(self.context, len(name))): self._increment_stats(name[0:i], name[i]) for i in range(self.context, len(name)): @@ -189,7 +188,7 @@ def main(): fp.close() try: - fp = open(opt.save_stats, 'wb') + fp = open(opt.save_stats, 'w') except TypeError: pass except IOError: -- cgit v1.2.3