Skip to content

Commit 110d700

Browse files
author
Xiaozhou Li
authored
Merge pull request #37 from Ultimaker/fix/typing-in-comment-backward-compatibility
Python 3.4, print-cluster, backward compatibility
2 parents f132ccf + 136a2f1 commit 110d700

2 files changed

Lines changed: 3 additions & 2 deletions

File tree

Charon/filetypes/OpenPackagingConvention.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ class OpenPackagingConvention(FileInterface):
2525
_global_metadata_file = "/Metadata/OPC_Global.json" # Where the global metadata file is.
2626
_opc_metadata_relationship_type = "http://schemas.ultimaker.org/package/2018/relationships/opc_metadata" # Unique identifier of the relationship type that relates OPC metadata to files.
2727
_metadata_prefix = "/metadata"
28-
_aliases:Dict[str, str] = OrderedDict([]) # A standard OPC file doest not have default aliases. These must be implemented in inherited classes.
28+
_aliases = OrderedDict([]) # type: Dict[str, str] # A standard OPC file doest not have default aliases. These must be implemented in inherited classes.
2929

3030
mime_type = "application/x-opc"
3131

@@ -299,7 +299,7 @@ def _processAliases(self, virtual_path: str) -> str:
299299
# Replace all aliases.
300300
for regex, replacement in self._aliases.items():
301301
if regex.startswith("/"):
302-
expression = rf"^{regex}"
302+
expression = r"^" + regex
303303
else:
304304
expression = regex
305305
virtual_path = re.sub(expression, replacement, virtual_path)

mypy.ini

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
[mypy]
2+
python_version = 3.4
23
disallow_untyped_calls = False
34
disallow_untyped_defs = False
45
disallow_incomplete_defs = False

0 commit comments

Comments
 (0)