Issue #13748: Raw bytes literals can now be written with the `rb` prefix as well as `br`.
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 @@
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 != '\"') {