remove "== True" in your if argument. You can just check with sorting in dic.
change the if clause to:
if sort in dic:
and everything works as expected.
if-, . , , dict.
import collections
def groupByAnagram2(word_list):
dic = collections.defaultdict(list)
for x in word_list:
sort = ''.join(sorted(x))
dic[sort].append(x)
for words in dic.values():
for word in words:
print word