Commits

Jannis Leidel committed ec3725f

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

Comments (0)

Files changed (1)

 
 import os
 import subprocess
+import sys
 
 try:
     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')
             except:
                 # 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:
                     continue
                 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
         find_files_with_cmd(dirname)
 
+
 def hg_file_finder(dirname="."):
     """
     Find the files in ``dirname`` under Mercurial version control.