Skip to content

Commit

Permalink
Fix failing re tests
Browse files Browse the repository at this point in the history
  • Loading branch information
slozier committed Dec 25, 2024
1 parent 064c386 commit 0ad2080
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion Src/IronPython.Modules/re.cs
Original file line number Diff line number Diff line change
Expand Up @@ -167,7 +167,8 @@ public class Pattern : IWeakReferenceable {
internal Pattern(CodeContext/*!*/ context, object pattern, ReFlags flags = 0, bool compiled = false) {
_prePattern = PreParseRegex(context, PatternAsString(pattern, ref flags), verbose: flags.HasFlag(ReFlags.VERBOSE), isBytes: !flags.HasFlag(ReFlags.UNICODE), out ReFlags options);
flags |= options;
if (flags.HasFlag(ReFlags.UNICODE | ReFlags.LOCALE)) throw PythonOps.ValueError("cannot use LOCALE flag with a str pattern");
// TODO: re-enable in 3.6
// if (flags.HasFlag(ReFlags.UNICODE | ReFlags.LOCALE)) throw PythonOps.ValueError("cannot use LOCALE flag with a str pattern");
if (flags.HasFlag(ReFlags.ASCII | ReFlags.LOCALE)) throw PythonOps.ValueError("ASCII and LOCALE flags are incompatible");
_re = GenRegex(context, _prePattern, flags, compiled, false);
this.pattern = pattern;
Expand Down

0 comments on commit 0ad2080

Please sign in to comment.