Commits

Oben Sonne committed 89d3c31

More compact code (minor)

Anyone sees a problem on readability here?

Comments (0)

Files changed (1)

 
     # macro module
     fname = opj(opts.project, "macros.py")
-    macmod = opx(fname) and imp.load_source("macros", fname)
-    if macmod:
-        macros = macmod.__dict__
-    else:
-        # No macros module was defined, but we still need a dictionary
-        # to use as globals when evaluating expressions
-        macros = {}
+    macros = imp.load_source("macros", fname).__dict__ if opx(fname) else {}
 
     macros["__encoding__"] = opts.output_enc
     macros["options"] = opts
 # =============================================================================
 # template helper functions
 # =============================================================================
+
 def htmlspecialchars(s):
     """
     Replace the characters that are special within HTML (&, <, > and ")