tardyp / buildbot_profiler

GNU General Public License v2.0
4 stars 2 forks source link

bbprofiler fails due to __future__ import #4

Open GretaCB opened 5 years ago

GretaCB commented 5 years ago

Hello 👋 ,

I installed buildbot-profiler and gave it a first try today. When running bbprofiler, I hit the following error:

~/dev/$ bbprofiler 
Traceback (most recent call last):
  File "/home/ci/.local/bin/bbprofiler", line 6, in <module>
    from buildbot_profiler.app import main
  File "/home/ci/.local/lib/python3.5/site-packages/buildbot_profiler/app.py", line 4
    from __future__ import print_function
    ^
SyntaxError: from __future__ imports must occur at the beginning of the file

So I moved the __future__ imports line to the top of the app.py file, and the profiler ran fine 👍 .

Looking at the commit history, looks like this bug snuck in via the following commit: https://github.com/tardyp/buildbot_profiler/commit/6cfa72e44ecb5162b1de438548831bf91b91e4b8#diff-302462ca31883e37cfbc2956b8df9e06


Env info in case relevant

Thanks for your work on this awesome profiler!

vext01 commented 2 months ago

Same here:

$ bbprofiler
Traceback (most recent call last):
  File "/opt/buildbot/bin/bbprofiler", line 5, in <module>
    from buildbot_profiler.app import main
  File "/opt/buildbot/lib/python3.11/site-packages/buildbot_profiler/app.py", line 4
    from __future__ import print_function
    ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
SyntaxError: from __future__ imports must occur at the beginning of the file