Patchwork D1555: py3: use bytes in place of basestring

login
register
mail settings
Submitter phabricator
Date Dec. 1, 2017, 2:13 p.m.
Message ID <9c5c0cd9429017e4b633b65218582737@localhost.localdomain>
Download mbox | patch
Permalink /patch/25860/
State Not Applicable
Headers show

Comments

phabricator - Dec. 1, 2017, 2:13 p.m.
pulkit updated this revision to Diff 4048.
pulkit edited the summary of this revision.
pulkit retitled this revision from "py3: add pycompat.basestring and use it" to "py3: use bytes in place of basestring".

REPOSITORY
  rHG Mercurial

CHANGES SINCE LAST UPDATE
  https://phab.mercurial-scm.org/D1555?vs=3979&id=4048

REVISION DETAIL
  https://phab.mercurial-scm.org/D1555

AFFECTED FILES
  hgext/convert/convcmd.py
  mercurial/cmdutil.py
  mercurial/httppeer.py

CHANGE DETAILS




To: pulkit, #hg-reviewers, yuja
Cc: yuja, mercurial-devel

Patch

diff --git a/mercurial/httppeer.py b/mercurial/httppeer.py
--- a/mercurial/httppeer.py
+++ b/mercurial/httppeer.py
@@ -222,7 +222,7 @@ 
             if not data:
                 data = strargs
             else:
-                if isinstance(data, basestring):
+                if isinstance(data, bytes):
                     i = io.BytesIO(data)
                     i.length = len(data)
                     data = i
diff --git a/mercurial/cmdutil.py b/mercurial/cmdutil.py
--- a/mercurial/cmdutil.py
+++ b/mercurial/cmdutil.py
@@ -3720,7 +3720,7 @@ 
                                 else:
                                     util.rename(target, bakname)
                     if ui.verbose or not exact:
-                        if not isinstance(msg, basestring):
+                        if not isinstance(msg, bytes):
                             msg = msg(abs)
                         ui.status(msg % rel)
                 elif exact:
diff --git a/hgext/convert/convcmd.py b/hgext/convert/convcmd.py
--- a/hgext/convert/convcmd.py
+++ b/hgext/convert/convcmd.py
@@ -450,7 +450,7 @@ 
         commit = self.commitcache[rev]
         full = self.opts.get('full')
         changes = self.source.getchanges(rev, full)
-        if isinstance(changes, basestring):
+        if isinstance(changes, bytes):
             if changes == SKIPREV:
                 dest = SKIPREV
             else: