[PATCH evolve-ext] serveronly: replace exc.message with str(exc)

Arun Kulshreshtha kulshrax at fb.com
Thu Mar 9 15:24:09 EST 2017


# HG changeset patch
# User Arun Kulshreshtha <kulshrax at fb.com>
# Date 1489090827 28800
#      Thu Mar 09 12:20:27 2017 -0800
# Node ID 967b1ad8617442c46131477708068badd029904c
# Parent  7d15775d85857c13843dd1c76626293550006d81
serveronly: replace exc.message with str(exc)

BaseException.message is deprecated in Python 2.6, so use str() instead.

diff --git a/hgext3rd/evolve/serveronly.py b/hgext3rd/evolve/serveronly.py
--- a/hgext3rd/evolve/serveronly.py
+++ b/hgext3rd/evolve/serveronly.py
@@ -21,7 +21,7 @@
         obsexchange,
     )
 except ValueError as exc:
-    if exc.message != 'Attempted relative import in non-package':
+    if str(exc) != 'Attempted relative import in non-package':
         raise
     # extension imported using direct path
     sys.path.insert(0, os.path.dirname(os.path.dirname(__file__)))


More information about the Mercurial-devel mailing list