changeset 36559:5374a22d014a

convert: use our shlex wrapper in filemap to avoid Python 3 tracebacks Differential Revision: https://phab.mercurial-scm.org/D2527
author Augie Fackler <augie@google.com>
date Thu, 01 Mar 2018 17:48:06 -0500
parents d4c98b6724e1
children 41c0e7b7869c
files hgext/convert/filemap.py
diffstat 1 files changed, 2 insertions(+), 3 deletions(-) [+]
line wrap: on
line diff
--- a/hgext/convert/filemap.py	Thu Mar 01 17:47:49 2018 -0500
+++ b/hgext/convert/filemap.py	Thu Mar 01 17:48:06 2018 -0500
@@ -7,7 +7,6 @@
 from __future__ import absolute_import, print_function
 
 import posixpath
-import shlex
 
 from mercurial.i18n import _
 from mercurial import (
@@ -71,8 +70,8 @@
                              (lex.infile, lex.lineno, listname, name))
                 return 1
             return 0
-        lex = shlex.shlex(open(path, 'rb'), path, True)
-        lex.wordchars += '!@#$%^&*()-=+[]{}|;:,./<>?'
+        lex = common.shlexer(
+            filepath=path, wordchars='!@#$%^&*()-=+[]{}|;:,./<>?')
         cmd = lex.get_token()
         while cmd:
             if cmd == 'include':