Commit 20cb719e authored by defacto133's avatar defacto133
Browse files

Fix test for unicode so that it works in both py2 and py3

parent 328a7faa
......@@ -7,6 +7,7 @@
from random import Random
import os
import re
import sys
import numpy as np
from operator import itemgetter
......@@ -253,7 +254,8 @@ class WordCloud(object):
d = {}
flags = re.UNICODE if type(text) is str else 0
flags = re.UNICODE if sys.version < '3' and \
type(text) is unicode else 0
for word in re.findall(r"\w[\w']*", text, flags=flags):
if word.isdigit():
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment