diff options
Diffstat (limited to 'Tools')
-rw-r--r-- | Tools/scripts/deepfreeze.py | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/Tools/scripts/deepfreeze.py b/Tools/scripts/deepfreeze.py index f9fd4e3..62eeafa 100644 --- a/Tools/scripts/deepfreeze.py +++ b/Tools/scripts/deepfreeze.py @@ -359,7 +359,12 @@ class Printer: return f"&{name}.ob_base" def generate_frozenset(self, name: str, fs: FrozenSet[object]) -> str: - ret = self.generate_tuple(name, tuple(sorted(fs))) + try: + fs = sorted(fs) + except TypeError: + # frozen set with incompatible types, fallback to repr() + fs = sorted(fs, key=repr) + ret = self.generate_tuple(name, tuple(fs)) self.write("// TODO: The above tuple should be a frozenset") return ret |