tests/hghave.py
changeset 28126 562a073a2a1b
parent 27702 39122c2442cd
child 28383 e13e0e189990
equal deleted inserted replaced
28125:3b4537ba80e9 28126:562a073a2a1b
   332         import pygments
   332         import pygments
   333         pygments.highlight # silence unused import warning
   333         pygments.highlight # silence unused import warning
   334         return True
   334         return True
   335     except ImportError:
   335     except ImportError:
   336         return False
   336         return False
   337 
       
   338 @check("json", "some json module available")
       
   339 def has_json():
       
   340     try:
       
   341         import json
       
   342         json.dumps
       
   343         return True
       
   344     except ImportError:
       
   345         try:
       
   346             import simplejson as json
       
   347             json.dumps
       
   348             return True
       
   349         except ImportError:
       
   350             pass
       
   351     return False
       
   352 
   337 
   353 @check("outer-repo", "outer repo")
   338 @check("outer-repo", "outer repo")
   354 def has_outer_repo():
   339 def has_outer_repo():
   355     # failing for other reasons than 'no repo' imply that there is a repo
   340     # failing for other reasons than 'no repo' imply that there is a repo
   356     return not matchoutput('hg root 2>&1',
   341     return not matchoutput('hg root 2>&1',