# HG changeset patch # User Jason R. Coombs # Date 2023-04-20 20:07:47 # Node ID 057639af827cd363ae7d5c23ab46fc56d352953a # Parent f4a540c203d73394440ee9a6e6ab14c380994ddc hg: move unreachable code to where it could be reached diff --git a/hg b/hg --- a/hg +++ b/hg @@ -38,21 +38,21 @@ if getattr(sys, 'frozen', None) == 'cons ) ) -from hgdemandimport import tracing +try: + from hgdemandimport import tracing +except ImportError: + sys.stderr.write( + "abort: couldn't find mercurial libraries in [%s]\n" + % ' '.join(sys.path) + ) + sys.stderr.write("(check your install and PYTHONPATH)\n") + sys.exit(-1) with tracing.log('hg script'): # enable importing on demand to reduce startup time - try: - import hgdemandimport + import hgdemandimport - hgdemandimport.enable() - except ImportError: - sys.stderr.write( - "abort: couldn't find mercurial libraries in [%s]\n" - % ' '.join(sys.path) - ) - sys.stderr.write("(check your install and PYTHONPATH)\n") - sys.exit(-1) + hgdemandimport.enable() from mercurial import dispatch