Patchwork D1096: releasenotes: make the import of fuzzywuzzy optional

login
register
mail settings
Submitter phabricator
Date Oct. 16, 2017, 6:28 p.m.
Message ID <42bcc316062ae24f229a093cea1fc3a0@localhost.localdomain>
Download mbox | patch
Permalink /patch/25025/
State Not Applicable
Headers show

Comments

phabricator - Oct. 16, 2017, 6:28 p.m.
pulkit updated this revision to Diff 2830.

REPOSITORY
  rHG Mercurial

CHANGES SINCE LAST UPDATE
  https://phab.mercurial-scm.org/D1096?vs=2786&id=2830

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

AFFECTED FILES
  hgext/releasenotes.py

CHANGE DETAILS




To: pulkit, #hg-reviewers, yuja
Cc: yuja, mercurial-devel

Patch

diff --git a/hgext/releasenotes.py b/hgext/releasenotes.py
--- a/hgext/releasenotes.py
+++ b/hgext/releasenotes.py
@@ -218,7 +218,12 @@ 
     """
     Returns false when note fragment can be merged to existing notes.
     """
-    import fuzzywuzzy.fuzz as fuzz
+    try:
+        import fuzzywuzzy.fuzz as fuzz
+        fuzz.token_set_ratio
+    except ImportError:
+        return True
+
     merge = True
     for bullet in existingnotes:
         score = fuzz.token_set_ratio(incoming_str, bullet)