Workaround Python 2.6 bug.
authorDavid Anderson <dvander@alliedmods.net>
Mon Nov 18 10:13:25 2013 -0800 (2013-11-18)
changeset 19574dedf99c458
parent 194 2cd13298c896
child 196 9ea2563b75c8
Workaround Python 2.6 bug.
ambuild2/frontend/base_gen.py
     1.1 --- a/ambuild2/frontend/base_gen.py	Fri Nov 15 23:38:41 2013 -0800
     1.2 +++ b/ambuild2/frontend/base_gen.py	Mon Nov 18 10:13:25 2013 -0800
     1.3 @@ -163,7 +163,13 @@
     1.4      rvalue = None
     1.5      with open(os.path.join(self.sourcePath, file)) as fp:
     1.6        chars = fp.read()
     1.7 +
     1.8 +      # Python 2.6 can't compile() with Windows line endings?!?!!?
     1.9 +      chars = chars.replace('\r\n', '\n')
    1.10 +      chars = chars.replace('\r', '\n')
    1.11 +
    1.12        code = compile(chars, file, 'exec')
    1.13 +
    1.14      exec(code, new_vars)
    1.15      if 'rvalue' in new_vars:
    1.16        rvalue = new_vars['rvalue']