Skip to content

Commit

Permalink
Fix test
Browse files Browse the repository at this point in the history
  • Loading branch information
wu0607 committed Feb 5, 2025
1 parent fd8e554 commit 36eaa85
Showing 1 changed file with 7 additions and 6 deletions.
13 changes: 7 additions & 6 deletions hydra/core/override_parser/overrides_parser.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,6 @@
import sys
from typing import Any, List, Optional

from omegaconf.vendor.antlr4.error.Errors import (
LexerNoViableAltException,
RecognitionException,
)

from hydra._internal.grammar import grammar_functions
from hydra._internal.grammar.functions import Functions
from hydra.core.config_loader import ConfigLoader
Expand All @@ -17,6 +12,11 @@
from hydra.core.override_parser.types import Override
from hydra.errors import HydraException, OverrideParseException

from omegaconf.vendor.antlr4.error.Errors import (
LexerNoViableAltException,
RecognitionException,
)

try:
from hydra.grammar.gen.OverrideLexer import ( # type: ignore[attr-defined]
CommonTokenStream,
Expand Down Expand Up @@ -98,7 +98,8 @@ def parse_overrides(self, overrides: List[str]) -> List[Override]:
msg = f"Error parsing override '{override}'" f"\n{e}"
raise OverrideParseException(
override=override,
message=f"Error when parsing index: {idx}, string: {override} out of {overrides}. {msg}"
message=f"Error when parsing index: {idx}, string: {override} out of {overrides}."
f"\n{msg}"
f"\nSee https://hydra.cc/docs/1.2/advanced/override_grammar/basic for details",
) from e.__cause__
assert isinstance(parsed, Override)
Expand Down

0 comments on commit 36eaa85

Please sign in to comment.