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

Fix 'ValueError' upon empty linenos variable #118

Merged
merged 1 commit into from
Feb 20, 2022
Merged

Conversation

yarula
Copy link
Contributor

@yarula yarula commented Jan 24, 2022

Profiler crashes in case when linenos is an empty list
'ValueError: max() arg is an empty sequence'

Let's add an extra check for linenos before passing it to a max-function

Profiler crashes in case when linenos is an empty list
'ValueError: max() arg is an empty sequence'

Let's add an extra check for linenos before passing it to a max-function
@Erotemic
Copy link
Member

Thanks for the fix! Can you add a unit test that triggers this case?

@codecov
Copy link

codecov bot commented Jan 24, 2022

Codecov Report

Merging #118 (6e9dcc7) into main (5994c08) will not change coverage.
The diff coverage is 0.00%.

Impacted file tree graph

@@           Coverage Diff           @@
##             main     #118   +/-   ##
=======================================
  Coverage   54.13%   54.13%           
=======================================
  Files           4        4           
  Lines         375      375           
  Branches       57       57           
=======================================
  Hits          203      203           
  Misses        155      155           
  Partials       17       17           
Impacted Files Coverage Δ
line_profiler/line_profiler.py 41.63% <0.00%> (ø)

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 5994c08...6e9dcc7. Read the comment docs.

@Erotemic
Copy link
Member

This is probably fine without a test and it does fix an issue. Merging.

@Erotemic Erotemic merged commit 36b9863 into pyutils:main Feb 20, 2022
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