Commit cbacf54f by Bert JW Regeer Committed by Sébastien Eustace

Update the _canonicalize_regex to no longer modify periods (#115)

This also updates the `module_name` helper function so that it still
replaces periods with underscores as it did previously.
parent 42173665
...@@ -5,7 +5,7 @@ import tempfile ...@@ -5,7 +5,7 @@ import tempfile
from contextlib import contextmanager from contextlib import contextmanager
from typing import Union from typing import Union
_canonicalize_regex = re.compile('[-_.]+') _canonicalize_regex = re.compile('[-_]+')
def canonicalize_name(name): # type: (str) -> str def canonicalize_name(name): # type: (str) -> str
...@@ -13,7 +13,7 @@ def canonicalize_name(name): # type: (str) -> str ...@@ -13,7 +13,7 @@ def canonicalize_name(name): # type: (str) -> str
def module_name(name): # type: (str) -> str def module_name(name): # type: (str) -> str
return canonicalize_name(name).replace('-', '_') return canonicalize_name(name).replace('.', '_').replace('-', '_')
@contextmanager @contextmanager
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment