Skip to content

Commit

Permalink
Drop imports from deprecated distutils (#199)
Browse files Browse the repository at this point in the history
  • Loading branch information
soininen authored Apr 2, 2024
2 parents 00b93ca + 99ae068 commit c72a57d
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions spine_items/importer/flattened_mappings.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,12 +11,11 @@
######################################################################################################################

"""Contains a model to handle source tables and import mapping."""
from distutils.util import strtobool
from enum import Enum, unique
from spinedb_api.mapping import Position
from spinedb_api.parameter_value import split_value_and_type
from spinedb_api import from_database, ParameterValueFormatError
from spinedb_api.helpers import fix_name_ambiguity
from spinedb_api.helpers import fix_name_ambiguity, string_to_bool
from spinedb_api.import_mapping.import_mapping import (
EntityClassMapping,
EntityMapping,
Expand Down Expand Up @@ -368,7 +367,7 @@ def display_position(self, row):
# B) Handle all other cases cases
if component.position == Position.hidden:
if self._display_names[row].endswith("flags") and not isinstance(component.value, bool):
return bool(strtobool(component.value))
return string_to_bool(str(component.value))
return component.value
if component.position == Position.header:
if component.value is None:
Expand Down

0 comments on commit c72a57d

Please sign in to comment.