Patchwork [5,of,9] py3: check for bytes instead of str in isinstance

login
register
mail settings
Submitter Pulkit Goyal
Date June 23, 2017, 7:54 p.m.
Message ID <98d32035dd1031198057.1498247699@workspace>
Download mbox | patch
Permalink /patch/21648/
State Accepted
Headers show

Comments

Pulkit Goyal - June 23, 2017, 7:54 p.m.
# HG changeset patch
# User Pulkit Goyal <7895pulkit@gmail.com>
# Date 1498081811 -19800
#      Thu Jun 22 03:20:11 2017 +0530
# Node ID 98d32035dd10311980576a1007ca0ba1cf98240f
# Parent  4e2f4798c3785ff716264679aa34122cc158bd02
py3: check for bytes instead of str in isinstance

Patch

diff --git a/mercurial/hg.py b/mercurial/hg.py
--- a/mercurial/hg.py
+++ b/mercurial/hg.py
@@ -130,7 +130,7 @@ 
 
 def islocal(repo):
     '''return true if repo (or path pointing to repo) is local'''
-    if isinstance(repo, str):
+    if isinstance(repo, bytes):
         try:
             return _peerlookup(repo).islocal(repo)
         except AttributeError: