D6123: ZeroDivisionError: Add condition to avoid Zerodivisonerror due to float number (issue6099)

av6 (Anton Shestakov) phabricator at mercurial-scm.org
Wed Mar 13 14:02:44 EDT 2019


av6 added a comment.


  Okay, let's go over #1 in https://www.mercurial-scm.org/wiki/ContributingChanges#Submission_checklist once more. If you want to know what a good "topic" is, look at what other people do. How patches that get accepted generally look. How bug-fixing commits are worded.
  
  Secondly, about that capitalization. I'm sorry if this is some sort of silly autocorrect that's doing it for you, I really hope you're not writing commit messages on a phone.

INLINE COMMENTS

> similar.py:66-67
>      lengths = len(text) + len(orig)
> -    return equal * 2.0 / lengths
> +    if lengths > 0:
> +        return equal * 2.0 / lengths
>  

`None > 1` is still an issue, see my comment above.

REPOSITORY
  rHG Mercurial

REVISION DETAIL
  https://phab.mercurial-scm.org/D6123

To: akshjain.jain74, durin42, #hg-reviewers
Cc: av6, pulkit, mercurial-devel


More information about the Mercurial-devel mailing list