Patchwork [9,of,9] py3: use single quotes instead of triple quotes so that transformer adds b''

login
register
mail settings
Submitter Pulkit Goyal
Date June 23, 2017, 7:55 p.m.
Message ID <22050fe9a887164bb56a.1498247703@workspace>
Download mbox | patch
Permalink /patch/21652/
State Accepted
Headers show

Comments

Pulkit Goyal - June 23, 2017, 7:55 p.m.
# HG changeset patch
# User Pulkit Goyal <7895pulkit@gmail.com>
# Date 1498238182 -19800
#      Fri Jun 23 22:46:22 2017 +0530
# Node ID 22050fe9a887164bb56a0a3cce97087e036a5cb7
# Parent  aa28c0ebd878a5c3598700efe662d2dfba9b4f60
py3: use single quotes instead of triple quotes so that transformer adds b''
Yuya Nishihara - June 24, 2017, 3:30 a.m.
On Sat, 24 Jun 2017 01:25:03 +0530, Pulkit Goyal wrote:
> # HG changeset patch
> # User Pulkit Goyal <7895pulkit@gmail.com>
> # Date 1498238182 -19800
> #      Fri Jun 23 22:46:22 2017 +0530
> # Node ID 22050fe9a887164bb56a0a3cce97087e036a5cb7
> # Parent  aa28c0ebd878a5c3598700efe662d2dfba9b4f60
> py3: use single quotes instead of triple quotes so that transformer adds b''
> 
> diff --git a/mercurial/util.py b/mercurial/util.py
> --- a/mercurial/util.py
> +++ b/mercurial/util.py
> @@ -1168,9 +1168,9 @@
>  
>      return hardlink, num
>  
> -_winreservednames = '''con prn aux nul
> -    com1 com2 com3 com4 com5 com6 com7 com8 com9
> -    lpt1 lpt2 lpt3 lpt4 lpt5 lpt6 lpt7 lpt8 lpt9'''.split()
> +_winreservednames = 'con prn aux nul\
> +    com1 com2 com3 com4 com5 com6 com7 com8 com9\
> +    lpt1 lpt2 lpt3 lpt4 lpt5 lpt6 lpt7 lpt8 lpt9'.split()

I slightly prefer b'''...''' over \ escapes. Or we could just write a list
of strings literally.

Patch

diff --git a/mercurial/util.py b/mercurial/util.py
--- a/mercurial/util.py
+++ b/mercurial/util.py
@@ -1168,9 +1168,9 @@ 
 
     return hardlink, num
 
-_winreservednames = '''con prn aux nul
-    com1 com2 com3 com4 com5 com6 com7 com8 com9
-    lpt1 lpt2 lpt3 lpt4 lpt5 lpt6 lpt7 lpt8 lpt9'''.split()
+_winreservednames = 'con prn aux nul\
+    com1 com2 com3 com4 com5 com6 com7 com8 com9\
+    lpt1 lpt2 lpt3 lpt4 lpt5 lpt6 lpt7 lpt8 lpt9'.split()
 _winreservedchars = ':*?"<>|'
 def checkwinfilename(path):
     r'''Check that the base-relative path is a valid filename on Windows.