Comment 3 for bug 1308508

Revision history for this message
Daniel Hahler (blueyed) wrote : Re: False positive F821 undefined name 'xxx'

I came across a similar issue like in comment #1, where flake8/pyflakes on python3 reports "F821: undefined name 'unicode'" , but the code path is not triggered for Python3:

    if sys.version_info < (3, 0):
        def __unicode__(self):
            return self.url

        def __add__(self, other):
            return unicode(self) + other
    else:
        def __str__(self):
            return self.url

        def __add__(self, other):
            return str(self) + other