def mk_template_paths(filepath, paths=None):
if filepath is None:<EOL><INDENT>return [os.curdir] if paths is None else paths<EOL><DEDENT>tmpldir = os.path.dirname(os.path.abspath(filepath))<EOL>return [tmpldir] if paths is None else paths + [tmpldir]<EOL>
Make template paths from given filepath and paths list.

:param filepath: (Base) filepath of template file or None
:param paths: A list of template search paths or None

>>> mk_template_paths("/tmp/t.j2", [])
['/tmp']
>>> mk_template_paths("/tmp/t.j2", ["/etc"])
['/etc', '/tmp']
>>> mk_template_paths(None, ["/etc"])
['/etc']