BlockCatIO / solidity-flattener

A python utility to flatten Solidity code with imports into a single file.
MIT License
265 stars 98 forks source link

solidity_flattener -h crashes #2

Closed yaronvel closed 7 years ago

yaronvel commented 7 years ago

I just try solidity_flattener -h and get

  File "/usr/local/bin/solidity_flattener", line 27
    print("FATAL: '{name}' was defined multiple times. Aborting.".format(name=contract_name), file=sys.stderr)

I am using ubuntu with python 3.5.

bajayo commented 7 years ago

Same thing here: File "/usr/local/bin/solidity_flattener", line 27 print("FATAL: '{name}' was defined multiple times. Aborting.".format(name=contract_name), file=sys.stderr) ^ SyntaxError: invalid syntax

bajayo commented 7 years ago

Sorry, using Mac OS Sierra 10.12.6 and Python 3.6.2

Stickerpants commented 7 years ago

This error happens if the script is executed under Python2. Will be looking into how to address this. Thanks for the report!

Qqwy commented 7 years ago

I think the easiest way to fix this is to change the shebang-line to, instead of pointing to the common location of /usr/bin/python, to /usr/bin/python3. Whether this is something you can do easily, or if it is something that pip usually manages for you and is hard to alter, I do not know.

At least, manually altering that line using sudo vim /usr/bin/solidity_flattener solved the problem for me, for now :slightly_smiling_face:.

Stickerpants commented 7 years ago

pip has been updated with the latest package. Please run pip3 install solidity-flattener --no-cache-dir -U in order to grab it, should be listed as version 0.2.0.

Thank you for the reports, everybody!