Skip to content

Commit

Permalink
dsl: python to yaml: don't assume module.__file__
Browse files Browse the repository at this point in the history
  • Loading branch information
aszs committed Nov 13, 2024
1 parent ac4cf6a commit 1c798bb
Showing 1 changed file with 1 addition and 5 deletions.
6 changes: 1 addition & 5 deletions tosca-package/tosca/python2yaml.py
Original file line number Diff line number Diff line change
@@ -1,15 +1,12 @@
# Copyright (c) 2023 Adam Souzis
# SPDX-License-Identifier: MIT
import importlib.util, importlib._bootstrap
import io
import inspect
from types import ModuleType
import sys
import os.path
from typing import (
Any,
Dict,
Set,
List,
Optional,
Tuple,
Expand Down Expand Up @@ -248,8 +245,7 @@ def _imported_module2yaml(self, module: ModuleType) -> Path:
module.__name__,
)
return yaml_path
assert module.__file__
if not self.write_policy.can_overwrite(module.__file__, str(yaml_path)):
if not self.write_policy.can_overwrite(str(path), str(yaml_path)):
logger.info(
"skipping saving imported python module as YAML %s: %s",
yaml_path,
Expand Down

0 comments on commit 1c798bb

Please sign in to comment.