Index: genshi/template/loader.py
===================================================================
--- genshi/template/loader.py	(revision 893)
+++ genshi/template/loader.py	(working copy)
@@ -163,7 +163,7 @@
         """
         if cls is None:
             cls = self.default_class
-        if relative_to and not os.path.isabs(relative_to):
+        if relative_to and not os.path.isabs(filename):
             filename = os.path.join(os.path.dirname(relative_to), filename)
         filename = os.path.normpath(filename)
         cachekey = filename
