From 64f7348d05253d022f86b95591901ee26b81361c Mon Sep 17 00:00:00 2001 From: laharah Date: Sat, 4 Jun 2016 13:06:27 -0700 Subject: [PATCH] `u""` cleanup on util.py and codes.py --- src/wormhole/codes.py | 4 ++-- src/wormhole/util.py | 1 + 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/src/wormhole/codes.py b/src/wormhole/codes.py index 8f922ae..a911f85 100644 --- a/src/wormhole/codes.py +++ b/src/wormhole/codes.py @@ -4,7 +4,7 @@ from .wordlist import (byte_to_even_word, byte_to_odd_word, even_words_lowercase, odd_words_lowercase) def make_code(channel_id, code_length): - assert isinstance(channel_id, type(u"")), type(channel_id) + assert isinstance(channel_id, type("")), type(channel_id) words = [] for i in range(code_length): # we start with an "odd word" @@ -12,7 +12,7 @@ def make_code(channel_id, code_length): words.append(byte_to_odd_word[os.urandom(1)].lower()) else: words.append(byte_to_even_word[os.urandom(1)].lower()) - return u"%s-%s" % (channel_id, u"-".join(words)) + return "%s-%s" % (channel_id, "-".join(words)) def extract_channel_id(code): channel_id = int(code.split("-")[0]) diff --git a/src/wormhole/util.py b/src/wormhole/util.py index 43dccfe..967243e 100644 --- a/src/wormhole/util.py +++ b/src/wormhole/util.py @@ -1,3 +1,4 @@ +# No unicode_literals import json, unicodedata from binascii import hexlify, unhexlify