Mercurial > hg-stable
diff hg @ 50568:057639af827c
hg: move unreachable code to where it could be reached
author | Jason R. Coombs <jaraco@jaraco.com> |
---|---|
date | Thu, 20 Apr 2023 16:07:47 -0400 |
parents | edab75a4c1da |
children | f4733654f144 |
line wrap: on
line diff
--- a/hg Tue May 23 01:39:47 2023 +0200 +++ b/hg Thu Apr 20 16:07:47 2023 -0400 @@ -38,21 +38,21 @@ ) ) -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