Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

don't use local variable 'pylibdir' in list comprehension in PyQt easyconfig, since that doesn't work in Python 3 #7848

Merged
merged 1 commit into from Mar 9, 2019

Conversation

boegel
Copy link
Member

@boegel boegel commented Mar 9, 2019

Parsing PyQt-4.12.3-fosscuda-2018b-Python-2.7.15.eb on top of Python 3 (using the 4.x branches) fails with:

  File "/home/travis/virtualenv/python3.6.3/lib/python3.6/site-packages/easybuild_framework-3.9.0.dev0-py3.6.egg/easybuild/framework/easyconfig/format/pyheaderconfigobj.py", line 187, in parse_pyheader
    exec(pyheader, global_vars, local_vars)
  File "<string>", line 60, in <module>
  File "<string>", line 60, in <listcomp>
NameError: name 'pylibdir' is not defined

This issue is similar to the one we danced around with #7797.

The underlying issue is probably that list comprehensions have their own scope in Python 3, see also https://portingguide.readthedocs.io/en/latest/comprehensions.html .

Another way to fix this is to declare pylibdir as global in the easyconfig, but I'd like to avoid that...

…yconfig, since that doesn't work in Python 3
@boegel boegel added change python3 Python 3 compatibility labels Mar 9, 2019
@boegel boegel added this to the next release (3.8.2) milestone Mar 9, 2019
@boegel
Copy link
Member Author

boegel commented Mar 9, 2019

Test report by @boegel
SUCCESS
Build succeeded for 1 out of 1 (1 easyconfigs in this PR)
node2402.golett.os - Linux centos linux 7.6.1810, Intel(R) Xeon(R) CPU E5-2680 v3 @ 2.50GHz, Python 2.7.5
See https://gist.github.com/bba16351f8924788b68202d5f59e8e09 for a full test report.

Copy link
Contributor

@akesandgren akesandgren left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@akesandgren
Copy link
Contributor

Test report by @akesandgren
SUCCESS
Build succeeded for 1 out of 1 (1 easyconfigs in this PR)
b-an03.hpc2n.umu.se - Linux ubuntu 16.04, Intel(R) Xeon(R) CPU E5-2690 v4 @ 2.60GHz, Python 2.7.12
See https://gist.github.com/bf1c88760eebc46efd3b5bf2333f6796 for a full test report.

@akesandgren
Copy link
Contributor

Going in, thanks @boegel!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
change python3 Python 3 compatibility
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants