Patchwork [1,of,2] py3: use raw string in comparison

login
register
mail settings
Submitter Rishabh Madan
Date March 14, 2017, 9:22 p.m.
Message ID <edfffaa46e84e546decb.1489526550@bunty>
Download mbox | patch
Permalink /patch/19340/
State Changes Requested
Headers show

Comments

Rishabh Madan - March 14, 2017, 9:22 p.m.
# HG changeset patch
# User Rishabh Madan <rishabhmadan96@gmail.com>
# Date 1489516332 -19800
#      Wed Mar 15 00:02:12 2017 +0530
# Node ID edfffaa46e84e546decb48107bc303888ee5501d
# Parent  37acdf027ae2575e7e280c97889a80f1dbd20e98
py3: use raw string in comparison

Patch

diff -r 37acdf027ae2 -r edfffaa46e84 mercurial/match.py
--- a/mercurial/match.py	Sun Mar 12 11:47:02 2017 -0700
+++ b/mercurial/match.py	Wed Mar 15 00:02:12 2017 +0530
@@ -742,7 +742,7 @@ 
 
     fp = open(filepath)
     for lineno, line in enumerate(util.iterfile(fp), start=1):
-        if "#" in line:
+        if r"#" in line:
             global _commentre
             if not _commentre:
                 _commentre = util.re.compile(r'((?:^|[^\\])(?:\\\\)*)#.*')
@@ -756,7 +756,7 @@ 
         if not line:
             continue
 
-        if line.startswith('syntax:'):
+        if line.startswith(r'syntax:'):
             s = line[7:].strip()
             try:
                 syntax = syntaxes[s]