Skip to content

Commit

Permalink
fix versions parsing RegExp
Browse files Browse the repository at this point in the history
  • Loading branch information
ssi91 committed Feb 19, 2024
1 parent 405a3e4 commit dbd9658
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion brownie/project/sources.py
Original file line number Diff line number Diff line change
Expand Up @@ -231,7 +231,9 @@ def get_vyper_pragma_spec(source: str, path: Optional[str] = None) -> NpmSpec:
Returns: NpmSpec object
"""
pragma_match = next(re.finditer(r"(?:\n|^)\s*#\s*@version\s*([^\n]*)", source), None)
pragma_match = next(
re.finditer(r"(?:\n|^)\s*#\s*(?:pragma version|@version)\s*([^\n]*)", source), None
)
if pragma_match is None:
if path:
raise PragmaError(f"No version pragma in '{path}'")
Expand Down

0 comments on commit dbd9658

Please sign in to comment.