Commits

Jan-Jaap Driessen  committed bb02647

Combine checks into one.

  • Participants
  • Parent commits e52397f
  • Branches compilers-n-minifiers2

Comments (0)

Files changed (1)

File fanstatic/core.py

         if isinstance(source, self.__class__):
             # We are looking at a Resource instance.
             # The dependencies should be the same as the dependencies this mode replaces.
-            if source.depends != depends_in_mode:
+            if source.depends != depends_in_mode or source.supersedes != supersedes_in_mode:
                 raise ModeResourceDependencyError
-            if source.supersedes != supersedes_in_mode:
-                raise ModeResourceDependencyError
+            # XXX We are modifying an existing instance here. 
             source._mode = mode
             return source
         return self.__class__(self.library, source or self.source,