diff options
Diffstat (limited to 'Python/ast.c')
-rw-r--r-- | Python/ast.c | 19 |
1 files changed, 12 insertions, 7 deletions
diff --git a/Python/ast.c b/Python/ast.c index 48aef48..110754b 100644 --- a/Python/ast.c +++ b/Python/ast.c @@ -3744,13 +3744,18 @@ parsestr(struct compiling *c, const node *n, int *bytesmode) int rawmode = 0; int need_encoding; if (isalpha(quote)) { - if (quote == 'b' || quote == 'B') { - quote = *++s; - *bytesmode = 1; - } - if (quote == 'r' || quote == 'R') { - quote = *++s; - rawmode = 1; + while (!*bytesmode || !rawmode) { + if (quote == 'b' || quote == 'B') { + quote = *++s; + *bytesmode = 1; + } + else if (quote == 'r' || quote == 'R') { + quote = *++s; + rawmode = 1; + } + else { + break; + } } } if (quote != '\'' && quote != '\"') { |