Remove six usage

This repo does not support Python 2 anymore, so we don't need
six for compatibility between Python2 and 3, convert six usage to Python
3 code.

Change-Id: Id84564d8350fb793a2511abae218db17ea122873
Needed-By: https://review.opendev.org/701743
This commit is contained in:
Andreas Jaeger 2020-01-11 16:42:13 +01:00
parent 01dd28e53b
commit e6f423604a
3 changed files with 4 additions and 10 deletions

View File

@ -22,8 +22,6 @@ from django import template
from horizon.tables import base
import six
def get_data(self, datum, column, row):
"""Fetches the data to be displayed in this cell."""
@ -34,7 +32,7 @@ def get_data(self, datum, column, row):
widget = forms.CheckboxInput(check_test=lambda value: False)
# Convert value to string to avoid accidental type conversion
data = widget.render('object_ids',
six.text_type(table.get_object_id(datum)),
str(table.get_object_id(datum)),
{'class': 'table-row-multi-select'})
table._data_cache[column][table.get_object_id(datum)] = data
elif column.auto == "form_field":
@ -44,7 +42,7 @@ def get_data(self, datum, column, row):
widget_name = "%s__%s" % \
(column.name,
six.text_type(table.get_object_id(datum)))
str(table.get_object_id(datum)))
# Create local copy of attributes, so it don't change column
# class form_field_attributes

View File

@ -12,8 +12,6 @@
# See the License for the specific language governing permissions and
# limitations under the License.
import six
from django.urls import reverse
from django.utils.translation import ugettext_lazy as _
@ -78,7 +76,7 @@ class DefinitionForm(forms.SelfHandlingForm):
cleaned_data['definition']
)
except Exception as e:
raise forms.ValidationError(six.text_type(e))
raise forms.ValidationError(str(e))
if not validated.get('valid'):
raise forms.ValidationError(

View File

@ -12,8 +12,6 @@
# See the License for the specific language governing permissions and
# limitations under the License.
import six
from django.urls import reverse
from django.utils.translation import ugettext_lazy as _
@ -131,7 +129,7 @@ class DefinitionForm(forms.SelfHandlingForm):
cleaned_data['definition']
)
except Exception as e:
raise forms.ValidationError(six.text_type(e))
raise forms.ValidationError(str(e))
if not validated.get('valid'):
raise forms.ValidationError(