"""
def __init__(self, searchpath, encoding='utf-8'):
- if isinstance(searchpath, basestring):
+ if isinstance(searchpath, str):
searchpath = [searchpath]
self.searchpath = list(searchpath)
self.encoding = encoding
rv = self.load_func(template)
if rv is None:
raise TemplateNotFound(template)
- elif isinstance(rv, basestring):
+ elif isinstance(rv, str):
return rv, None, None
return rv
def list_templates(self):
result = []
- for prefix, loader in self.mapping.iteritems():
+ for prefix, loader in self.mapping.items():
for template in loader.list_templates():
result.append(prefix + self.delimiter + template)
return result
# create a fake module that looks for the templates in the
# path given.
mod = _TemplateModule(package_name)
- if isinstance(path, basestring):
+ if isinstance(path, str):
path = [path]
else:
path = list(path)