-1

So, i've been trying to compile a program using sconstruct, but i'm facing a problem. I got the following error when trying to compile a program using sconstruct.

D:\RN ENGINE - REV #1\neo>scons
   scons: Reading SConscript files ...
   File "sys/scons\scons_utils.py", line 19
            except OSError, x:
                          ^
SyntaxError: invalid syntax

I have tried to look for the file where the error is occured, which is scons_utils.py, but i didn't manage to find it, and the documentation didn't helped me very well. Is this a bug on the sconstruct itself, or i did something wrong? Thanks.

If something else is required in order to solve this, i won't hesitate to give it.

1 Answers1

1

scons_utils.py is not a SCons file. So it's likely part of whatever you're trying to build.

Likely you're using python 3.5+ with a newer SCons, and previously you were using python 2.7 and older SCons.

SO the issue you see (once you find the file) is python 2.7 vs python 3.5+. Try running again with --debug=stacktrace which should hopefully give you the full path to scons_utils.py

Change that line to:

    except OSError as x:
bdbaddog
  • 3,357
  • 2
  • 22
  • 33
  • 1
    It's probably worth running the 2to3 tool on SConstruct/SConscript files and on any added utilities like this, if they haven't been vetted for use in a Python 3 environment. It usually does just fine converting the common cases like exception syntax, print statement -> function, etc. You should be able to find `scons_utills.py` since Python is finding it.... – Mats Wichmann Dec 14 '20 at 17:35