diff -r a542ad320adb -r bc2caa4b4480 hgext/releasenotes.py --- a/hgext/releasenotes.py Sun Oct 15 20:31:44 2017 +0530 +++ b/hgext/releasenotes.py Mon Oct 16 22:46:11 2017 +0530 @@ -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