Internal use for checking if a duplicate safe attribute already exists :param item: Item to see if a dup exists
(self, item)
| 950 | return out |
| 951 | |
| 952 | def _conversion_checks(self, item): |
| 953 | """ |
| 954 | Internal use for checking if a duplicate safe attribute already exists |
| 955 | |
| 956 | :param item: Item to see if a dup exists |
| 957 | """ |
| 958 | safe_item = self._safe_attr(item) |
| 959 | |
| 960 | if safe_item in self._box_config["__safe_keys"]: |
| 961 | dups = [f"{item}({safe_item})", f'{self._box_config["__safe_keys"][safe_item]}({safe_item})'] |
| 962 | if self._box_config["box_duplicates"].startswith("warn"): |
| 963 | warnings.warn(f"Duplicate conversion attributes exist: {dups}", BoxWarning) |
| 964 | else: |
| 965 | raise BoxError(f"Duplicate conversion attributes exist: {dups}") |
| 966 | |
| 967 | def to_json( |
| 968 | self, |
no test coverage detected