Jannis Leidel  committed ec3725f

Fixed changes made in 5ea01a2735cd to also work on Python 3.X.

  • Participants
  • Parent commits 219923b
  • Branches default

Comments (0)

Files changed (1)


 import os
 import subprocess
+import sys
     from mercurial.__version__ import version
 if os.environ.get('HG_SETUPTOOLS_FORCE_CMD', False):
     hg = None
 def find_files_with_cmd(dirname="."):
     Use the hg command to recursively find versioned files in dirname.
         return []
     return stdout.splitlines()
 def find_files_with_lib(dirname):
     Use the Mercurial library to recursively find versioned files in dirname.
                 match = cmdutil.match(repo, [], {}, default='relglob')
                 # Probably mercurial 1.8+
-                from mercurial import scmutil 
+                from mercurial import scmutil
                 match = scmutil.match(repo[None], [], {}, default='relglob')
             match.bad = lambda x, y: False
                 if abs in excluded:
                 yield abs
-    except Exception, e:
+    except Exception:
         if log:
-            log.warn("Error in setuptools_hg: %s" % e)
+            log.warn("Error in setuptools_hg: %s" % sys.exc_info()[1])
         # try calling hg command as a last resort
 def hg_file_finder(dirname="."):
     Find the files in ``dirname`` under Mercurial version control.