build.plat: fix dedent overrides.
authorAlain Péteut <alain.peteut@yahoo.com>
Thu, 27 Jun 2019 18:56:37 +0000 (20:56 +0200)
committerwhitequark <cz@m-labs.hk>
Fri, 28 Jun 2019 06:52:52 +0000 (06:52 +0000)
nmigen/build/plat.py

index 2f198a8c1ee7219415d4a75c3d7486c0ee51e984..7de062a8507711d2dcd2b3e7794123fceb03c857 100644 (file)
@@ -236,7 +236,10 @@ class TemplatedPlatform(Platform):
                 # `export VAR=` is treated on Linux.
                 return re.sub(r'^\"\"$', "", os.environ[var_env])
             elif var in kwargs:
-                return textwrap.dedent(kwargs[var]).strip()
+                if isinstance(kwargs[var], str):
+                    return textwrap.dedent(kwargs[var]).strip()
+                else:
+                    return kwargs[var]
             else:
                 return jinja2.Undefined(name=var)