public inbox for gentoo-catalyst@lists.gentoo.org
 help / color / mirror / Atom feed
* [gentoo-catalyst] [PATCH] lint: fix anomalous-backslash-in-string
@ 2015-10-06  3:47 Mike Frysinger
  2015-10-06  6:23 ` Brian Dolbec
  0 siblings, 1 reply; 2+ messages in thread
From: Mike Frysinger @ 2015-10-06  3:47 UTC (permalink / raw
  To: gentoo-catalyst

All strings using escape sequences should be raw strings.
This way we don't end up with accidental misbehavior.
---
 catalyst/config.py | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/catalyst/config.py b/catalyst/config.py
index 67d4e77..5d74dce 100644
--- a/catalyst/config.py
+++ b/catalyst/config.py
@@ -42,7 +42,7 @@ class ParserBase:
 		values = {}
 		cur_array = []
 
-		trailing_comment=re.compile('\s*#.*$')
+		trailing_comment=re.compile(r'\s*#.*$')
 		#white_space=re.compile('\s+')
 
 		for x, myline in enumerate(self.lines):
-- 
2.5.2



^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [gentoo-catalyst] [PATCH] lint: fix anomalous-backslash-in-string
  2015-10-06  3:47 [gentoo-catalyst] [PATCH] lint: fix anomalous-backslash-in-string Mike Frysinger
@ 2015-10-06  6:23 ` Brian Dolbec
  0 siblings, 0 replies; 2+ messages in thread
From: Brian Dolbec @ 2015-10-06  6:23 UTC (permalink / raw
  To: gentoo-catalyst

On Mon,  5 Oct 2015 23:47:55 -0400
Mike Frysinger <vapier@gentoo.org> wrote:

> All strings using escape sequences should be raw strings.
> This way we don't end up with accidental misbehavior.
> ---
>  catalyst/config.py | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/catalyst/config.py b/catalyst/config.py
> index 67d4e77..5d74dce 100644
> --- a/catalyst/config.py
> +++ b/catalyst/config.py
> @@ -42,7 +42,7 @@ class ParserBase:
>  		values = {}
>  		cur_array = []
>  
> -		trailing_comment=re.compile('\s*#.*$')
> +		trailing_comment=re.compile(r'\s*#.*$')
>  		#white_space=re.compile('\s+')
>  
>  		for x, myline in enumerate(self.lines):

good :)

-- 
Brian Dolbec <dolsen>



^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2015-10-06  6:23 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2015-10-06  3:47 [gentoo-catalyst] [PATCH] lint: fix anomalous-backslash-in-string Mike Frysinger
2015-10-06  6:23 ` Brian Dolbec

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox