Skip to content
Snippets Groups Projects
Commit bc2caa4b4480 authored by Pulkit Goyal's avatar Pulkit Goyal
Browse files

releasenotes: move import of fuzzywuzzy to import level

This will help us in determining easily that whether fuzzywuzzy is loaded or not
loaded in any of the function.

Differential Revision: https://phab.mercurial-scm.org/D1120
parent a542ad320adb
No related branches found
No related tags found
No related merge requests found
......@@ -33,6 +33,12 @@
cmdtable = {}
command = registrar.command(cmdtable)
try:
import fuzzywuzzy.fuzz as fuzz
fuzz.token_set_ratio
except ImportError:
fuzz = None
# Note for extension authors: ONLY specify testedwith = 'ships-with-hg-core' for
# extensions which SHIP WITH MERCURIAL. Non-mainline extensions should
# be specifying the version(s) of Mercurial they are tested with, or
......@@ -219,10 +225,8 @@
"""
Returns false when note fragment can be merged to existing notes.
"""
try:
import fuzzywuzzy.fuzz as fuzz
fuzz.token_set_ratio
except ImportError:
# fuzzywuzzy not present
if not fuzz:
return True
merge = True
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment