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

Return empty list instead of None #43

Merged
merged 1 commit into from
Nov 19, 2018

Conversation

jxltom
Copy link
Collaborator

@jxltom jxltom commented Nov 19, 2018

Closes pypa/pipenv#3247

It is because None can not be iterated in

version_order = [versions[v] for v in parse_pyenv_version_order() if v in versions]
when version order file does not exist

@techalchemy
Copy link
Member

Should we just check if the file exists first?

@jxltom
Copy link
Collaborator Author

jxltom commented Nov 19, 2018

It is already checked by os.path.exists(version_order_file), but this parse_pyenv_version_order will return None if file does not exist.

Actually even the order file does not exist, these functions should return empty list instead of None, otherwise for v in parse_pyenv_version_order() will raise error.

@techalchemy
Copy link
Member

ok sounds good to me

@techalchemy techalchemy merged commit 8499df1 into sarugaku:master Nov 19, 2018
@jxltom jxltom deleted the fix-iteration-error branch November 19, 2018 05:41
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants