← Back to team overview

launchpad-reviewers team mailing list archive

[Merge] ~cjwatson/launchpad:pyupgrade-py3-blueprints into launchpad:master

 

Colin Watson has proposed merging ~cjwatson/launchpad:pyupgrade-py3-blueprints into launchpad:master.

Commit message:
lp.blueprints: Apply "pyupgrade --py3-plus"

Requested reviews:
  Launchpad code reviewers (launchpad-reviewers)

For more details, see:
https://code.launchpad.net/~cjwatson/launchpad/+git/launchpad/+merge/412898
-- 
Your team Launchpad code reviewers is requested to review the proposed merge of ~cjwatson/launchpad:pyupgrade-py3-blueprints into launchpad:master.
diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml
index 17e1dff..8eaaf20 100644
--- a/.pre-commit-config.yaml
+++ b/.pre-commit-config.yaml
@@ -38,7 +38,14 @@ repos:
         alias: pyupgrade-py3
         name: pyupgrade (--py3-plus)
         args: [--keep-percent-format, --py3-plus]
-        files: ^lib/lp/(answers|app|archivepublisher|archiveuploader)/
+        files: |
+          (?x)^lib/lp/(
+            answers
+            |app
+            |archivepublisher
+            |archiveuploader
+            |blueprints
+          )/
 -   repo: https://github.com/PyCQA/isort
     rev: 5.9.2
     hooks:
diff --git a/lib/lp/blueprints/browser/person_upcomingwork.py b/lib/lp/blueprints/browser/person_upcomingwork.py
index 37b0030..e4b24bb 100644
--- a/lib/lp/blueprints/browser/person_upcomingwork.py
+++ b/lib/lp/blueprints/browser/person_upcomingwork.py
@@ -33,7 +33,7 @@ class PersonUpcomingWorkView(LaunchpadView):
     DAYS = 180
 
     def initialize(self):
-        super(PersonUpcomingWorkView, self).initialize()
+        super().initialize()
         self.workitem_counts = {}
         self.bugtask_counts = {}
         self.milestones_per_date = {}
@@ -79,7 +79,7 @@ class PersonUpcomingWorkView(LaunchpadView):
         return sorted(result.items(), key=itemgetter(0))
 
 
-class WorkItemContainer(object):
+class WorkItemContainer:
     """A container of work items, assigned to a person (or a team's
     participatns), whose milestone is due on a certain date.
     """
@@ -140,7 +140,7 @@ class SpecWorkItemContainer(WorkItemContainer):
     """A container of SpecificationWorkItems wrapped with GenericWorkItem."""
 
     def __init__(self, spec):
-        super(SpecWorkItemContainer, self).__init__()
+        super().__init__()
         self.spec = spec
         self.priority = spec.priority
         self.target = spec.target
diff --git a/lib/lp/blueprints/browser/specification.py b/lib/lp/blueprints/browser/specification.py
index 2f89e1e..a4b9cf8 100644
--- a/lib/lp/blueprints/browser/specification.py
+++ b/lib/lp/blueprints/browser/specification.py
@@ -221,7 +221,7 @@ class NewSpecificationView(LaunchpadFormView):
     def initialize(self):
         cache = IJSONRequestCache(self.request)
         json_dump_information_types(cache, self.info_types)
-        super(NewSpecificationView, self).initialize()
+        super().initialize()
 
     @action(_('Register Blueprint'), name='register')
     def register(self, action, data):
@@ -300,7 +300,7 @@ class NewSpecificationView(LaunchpadFormView):
 
     def validate(self, data):
         """See `LaunchpadFormView`.`"""
-        super(NewSpecificationView, self).validate(data)
+        super().validate(data)
         information_type = data.get('information_type', None)
         if information_type is None:
             # We rely on the model to set the correct default value.
@@ -324,7 +324,7 @@ class NewSpecificationView(LaunchpadFormView):
                     self.setFieldError('information_type', error)
 
     def setUpWidgets(self):
-        super(NewSpecificationView, self).setUpWidgets()
+        super().setUpWidgets()
         widget = self.widgets['drafter']
         widget.setRenderedValue(self.user)
 
@@ -378,7 +378,7 @@ class NewSpecificationFromDistroSeriesView(NewSpecificationFromSeriesView):
     """A view for creating a specification from a distro series."""
 
     def transform(self, data):
-        super(NewSpecificationFromDistroSeriesView, self).transform(data)
+        super().transform(data)
         data['distribution'] = self.context.distribution
 
 
@@ -386,7 +386,7 @@ class NewSpecificationFromProductSeriesView(NewSpecificationFromSeriesView):
     """A view for creating a specification from a product series."""
 
     def transform(self, data):
-        super(NewSpecificationFromProductSeriesView, self).transform(data)
+        super().transform(data)
         data['product'] = self.context.product
 
 
@@ -407,7 +407,7 @@ class NewSpecificationFromNonTargetView(NewSpecificationView):
 
         The name must be unique within the context of the chosen target.
         """
-        super(NewSpecificationFromNonTargetView, self).validate(data)
+        super().validate(data)
         name = data.get('name')
         target = data.get('target')
         if name is not None and target is not None:
@@ -447,7 +447,7 @@ class NewSpecificationFromSprintView(NewSpecificationFromNonTargetView):
         return self.append_info_type(fields)
 
     def transform(self, data):
-        super(NewSpecificationFromSprintView, self).transform(data)
+        super().transform(data)
         data['sprint'] = self.context
 
     @property
@@ -660,7 +660,7 @@ class SpecificationView(SpecificationSimpleView):
         return self.context.summary
 
     def initialize(self):
-        super(SpecificationView, self).initialize()
+        super().initialize()
         # The review that the user requested on this spec, if any.
         self.notices = []
 
@@ -1049,7 +1049,7 @@ class SpecificationSupersedingView(LaunchpadFormView):
 
     def validate(self, data):
         """See `LaunchpadFormView`.`"""
-        super(SpecificationSupersedingView, self).validate(data)
+        super().validate(data)
         if data['superseded_by']:
             spec = getUtility(ISpecificationSet).getByName(
                 self.context.target, data['superseded_by'])
@@ -1264,7 +1264,7 @@ class SpecGraph:
             L.append('%s -> %s' % (
                 to_DOT_ID(from_node.name), to_DOT_ID(to_node.name)))
         L.append('}')
-        return u'\n'.join(L)
+        return '\n'.join(L)
 
 
 class SpecificationSprintAddView(LaunchpadFormView):
@@ -1342,7 +1342,7 @@ class SpecGraphNode:
             # except the one that were currently on the page of.
             attrnames.append('URL')
         attrdict = {name: getattr(self, name) for name in attrnames}
-        return u'%s\n%s' % (to_DOT_ID(self.name), dict_to_DOT_attrs(attrdict))
+        return '%s\n%s' % (to_DOT_ID(self.name), dict_to_DOT_attrs(attrdict))
 
 
 def dict_to_DOT_attrs(some_dict, indent='    '):
@@ -1354,7 +1354,7 @@ def dict_to_DOT_attrs(some_dict, indent='    '):
     The attributes are sorted by dict key.
     """
     if not some_dict:
-        return u''
+        return ''
     L = []
     L.append('[')
     for key, value in sorted(some_dict.items()):
@@ -1363,7 +1363,7 @@ def dict_to_DOT_attrs(some_dict, indent='    '):
     lastitem = L.pop()
     L.append(lastitem[:-1])
     L.append(']')
-    return u'\n'.join('%s%s' % (indent, line) for line in L)
+    return '\n'.join('%s%s' % (indent, line) for line in L)
 
 
 def to_DOT_ID(value):
@@ -1378,10 +1378,10 @@ def to_DOT_ID(value):
     if isinstance(value, bytes):
         unitext = six.ensure_text(value, encoding='ascii')
     else:
-        unitext = six.text_type(value)
-    output = unitext.replace(u'"', u'\\"')
-    output = output.replace(u'\n', u'\\n')
-    return u'"%s"' % output
+        unitext = str(value)
+    output = unitext.replace('"', '\\"')
+    output = output.replace('\n', '\\n')
+    return '"%s"' % output
 
 
 class ProblemRenderingGraph(Exception):
@@ -1481,14 +1481,14 @@ class SpecificationTreeImageTag(SpecificationTreeGraphView):
             if isinstance(error, OSError):
                 # An OSError can be random. The image map may generate
                 # if the user reloads the page.
-                extra_help = u' Reload the page to link the image.'
+                extra_help = ' Reload the page to link the image.'
             else:
-                extra_help = u''
+                extra_help = ''
             image_map = (
-                u'<p class="error message">'
-                u'There was an error linking the dependency tree to its '
-                u'specs.' + extra_help + u'</p>')
-        return (u'<img src="deptree.png" usemap="#deptree" />\n' + image_map)
+                '<p class="error message">'
+                'There was an error linking the dependency tree to its '
+                'specs.' + extra_help + '</p>')
+        return ('<img src="deptree.png" usemap="#deptree" />\n' + image_map)
 
 
 class SpecificationTreeDotOutput(SpecificationTreeGraphView):
diff --git a/lib/lp/blueprints/browser/specificationbranch.py b/lib/lp/blueprints/browser/specificationbranch.py
index 5894e56..2c58b74 100644
--- a/lib/lp/blueprints/browser/specificationbranch.py
+++ b/lib/lp/blueprints/browser/specificationbranch.py
@@ -38,7 +38,7 @@ class SpecificationBranchURL:
 
     @property
     def path(self):
-        return u'+branch/%s' % self.branch.unique_name[1:]
+        return '+branch/%s' % self.branch.unique_name[1:]
 
 
 class SpecificationBranchStatusView(LaunchpadEditFormView):
@@ -50,7 +50,7 @@ class SpecificationBranchStatusView(LaunchpadEditFormView):
 
     def initialize(self):
         self.specification = self.context.specification
-        super(SpecificationBranchStatusView, self).initialize()
+        super().initialize()
 
     @property
     def next_url(self):
diff --git a/lib/lp/blueprints/browser/specificationgoal.py b/lib/lp/blueprints/browser/specificationgoal.py
index a7d6277..911e0f1 100644
--- a/lib/lp/blueprints/browser/specificationgoal.py
+++ b/lib/lp/blueprints/browser/specificationgoal.py
@@ -7,8 +7,6 @@ __all__ = [
     'GoalDecideView',
     ]
 
-
-import six
 from zope.component import getUtility
 
 from lp.blueprints.browser.specificationtarget import HasSpecificationsView
@@ -78,7 +76,7 @@ class GoalDecideView(HasSpecificationsView, LaunchpadView):
                 action = 'Declined'
 
         selected_specs = form['specification']
-        if isinstance(selected_specs, six.text_type):
+        if isinstance(selected_specs, str):
             # only a single item was selected, but we want to deal with a
             # list for the general case, so convert it to a list
             selected_specs = [selected_specs]
diff --git a/lib/lp/blueprints/browser/specificationtarget.py b/lib/lp/blueprints/browser/specificationtarget.py
index e7dcbd3..0de51ca 100644
--- a/lib/lp/blueprints/browser/specificationtarget.py
+++ b/lib/lp/blueprints/browser/specificationtarget.py
@@ -162,7 +162,7 @@ class HasSpecificationsView(LaunchpadView):
         # mixed in by the browser:page zcml directive the template defined in
         # the directive should be used.
         if safe_hasattr(self, 'index'):
-            return super(HasSpecificationsView, self).template
+            return super().template
 
         # Sprints and Persons don't have a usage enum for blueprints, so we
         # have to fallback to the default.
diff --git a/lib/lp/blueprints/browser/sprint.py b/lib/lp/blueprints/browser/sprint.py
index 3945820..84ac65e 100644
--- a/lib/lp/blueprints/browser/sprint.py
+++ b/lib/lp/blueprints/browser/sprint.py
@@ -457,7 +457,7 @@ class SprintTopicSetView(HasSpecificationsView, LaunchpadView):
                 action = 'Declined'
 
         selected_specs = form['speclink']
-        if isinstance(selected_specs, six.text_type):
+        if isinstance(selected_specs, str):
             # only a single item was selected, but we want to deal with a
             # list for the general case, so convert it to a list
             selected_specs = [selected_specs]
@@ -534,7 +534,7 @@ class SprintMeetingExportView(LaunchpadView):
     def render(self):
         self.request.response.setHeader(
             'content-type', 'application/xml;charset=utf-8')
-        body = super(SprintMeetingExportView, self).render()
+        body = super().render()
         return body.encode('utf-8')
 
 
diff --git a/lib/lp/blueprints/browser/sprintattendance.py b/lib/lp/blueprints/browser/sprintattendance.py
index 87ca4b5..a3ed9ba 100644
--- a/lib/lp/blueprints/browser/sprintattendance.py
+++ b/lib/lp/blueprints/browser/sprintattendance.py
@@ -170,9 +170,7 @@ class SprintAttendanceRegisterView(BaseSprintAttendanceAddView):
 
     @property
     def field_names(self):
-        return (
-            ['attendee'] +
-            super(SprintAttendanceRegisterView, self).field_names)
+        return ['attendee'] + super().field_names
 
     @property
     def initial_values(self):
diff --git a/lib/lp/blueprints/browser/tests/test_breadcrumbs.py b/lib/lp/blueprints/browser/tests/test_breadcrumbs.py
index 548ecf2..dc5c8e5 100644
--- a/lib/lp/blueprints/browser/tests/test_breadcrumbs.py
+++ b/lib/lp/blueprints/browser/tests/test_breadcrumbs.py
@@ -10,7 +10,7 @@ class TestHasSpecificationsBreadcrumbOnBlueprintsFacet(
     """Test Breadcrumbs for IHasSpecifications on the blueprints vhost."""
 
     def setUp(self):
-        super(TestHasSpecificationsBreadcrumbOnBlueprintsFacet, self).setUp()
+        super().setUp()
         self.person = self.factory.makePerson()
         self.person_specs_url = canonical_url(
             self.person, rootsite='blueprints')
@@ -38,7 +38,7 @@ class TestSpecificationBreadcrumb(BaseBreadcrumbTestCase):
     """Test breadcrumbs for an `ISpecification`."""
 
     def setUp(self):
-        super(TestSpecificationBreadcrumb, self).setUp()
+        super().setUp()
         self.product = self.factory.makeProduct(
             name='crumb-tester', displayname="Crumb Tester")
         self.specification = self.factory.makeSpecification(
diff --git a/lib/lp/blueprints/browser/tests/test_hasspecifications.py b/lib/lp/blueprints/browser/tests/test_hasspecifications.py
index 0823061..6046cae 100644
--- a/lib/lp/blueprints/browser/tests/test_hasspecifications.py
+++ b/lib/lp/blueprints/browser/tests/test_hasspecifications.py
@@ -14,7 +14,7 @@ class TestPersonSpecWorkloadView(TestCaseWithFactory):
     layer = DatabaseFunctionalLayer
 
     def setUp(self):
-        super(TestPersonSpecWorkloadView, self).setUp()
+        super().setUp()
         self.owner = self.factory.makePerson(name='blue')
         login_person(self.owner)
         self.team = self.factory.makeTeam(name='square', owner='blue')
diff --git a/lib/lp/blueprints/browser/tests/test_person_upcomingwork.py b/lib/lp/blueprints/browser/tests/test_person_upcomingwork.py
index 9c7d459..e867699 100644
--- a/lib/lp/blueprints/browser/tests/test_person_upcomingwork.py
+++ b/lib/lp/blueprints/browser/tests/test_person_upcomingwork.py
@@ -36,7 +36,7 @@ class Test_getWorkItemsDueBefore(TestCaseWithFactory):
     layer = DatabaseFunctionalLayer
 
     def setUp(self):
-        super(Test_getWorkItemsDueBefore, self).setUp()
+        super().setUp()
         self.today = datetime.today().date()
         current_milestone = self.factory.makeMilestone(
             dateexpected=self.today)
@@ -171,7 +171,7 @@ class TestGenericWorkItem(TestCaseWithFactory):
     layer = DatabaseFunctionalLayer
 
     def setUp(self):
-        super(TestGenericWorkItem, self).setUp()
+        super().setUp()
         today = datetime.today().date()
         self.milestone = self.factory.makeMilestone(dateexpected=today)
 
@@ -236,7 +236,7 @@ class TestPersonUpcomingWork(BrowserTestCase):
     layer = DatabaseFunctionalLayer
 
     def setUp(self):
-        super(TestPersonUpcomingWork, self).setUp()
+        super().setUp()
         self.today = datetime.today().date()
         self.tomorrow = self.today + timedelta(days=1)
         self.today_milestone = self.factory.makeMilestone(
@@ -413,7 +413,7 @@ class TestPersonUpcomingWorkView(TestCaseWithFactory):
     layer = DatabaseFunctionalLayer
 
     def setUp(self):
-        super(TestPersonUpcomingWorkView, self).setUp()
+        super().setUp()
         self.today = datetime.today().date()
         self.tomorrow = self.today + timedelta(days=1)
         self.today_milestone = self.factory.makeMilestone(
diff --git a/lib/lp/blueprints/browser/tests/test_specification.py b/lib/lp/blueprints/browser/tests/test_specification.py
index 192f0c2..655c5d1 100644
--- a/lib/lp/blueprints/browser/tests/test_specification.py
+++ b/lib/lp/blueprints/browser/tests/test_specification.py
@@ -507,7 +507,7 @@ class TestNewSpecificationInformationType(BrowserTestCase):
     layer = DatabaseFunctionalLayer
 
     def setUp(self):
-        super(TestNewSpecificationInformationType, self).setUp()
+        super().setUp()
         it_field = soupmatchers.Tag(
             'it-field', True, attrs=dict(name='field.information_type'))
         self.match_it = soupmatchers.HTMLContains(it_field)
diff --git a/lib/lp/blueprints/browser/tests/test_specificationtarget.py b/lib/lp/blueprints/browser/tests/test_specificationtarget.py
index 3364f1b..b992b69 100644
--- a/lib/lp/blueprints/browser/tests/test_specificationtarget.py
+++ b/lib/lp/blueprints/browser/tests/test_specificationtarget.py
@@ -2,7 +2,6 @@
 # GNU Affero General Public License version 3 (see the file LICENSE).
 
 from fixtures import FakeLogger
-import six
 from zope.component import getUtility
 from zope.security.proxy import removeSecurityProxy
 
@@ -127,7 +126,7 @@ class TestAssignments(TestCaseWithFactory):
     layer = DatabaseFunctionalLayer
 
     def setUp(self):
-        super(TestAssignments, self).setUp()
+        super().setUp()
         # Use a FakeLogger fixture to prevent Memcached warnings to be
         # printed to stdout while browsing pages.
         self.useFixture(FakeLogger())
@@ -151,7 +150,7 @@ class TestHasSpecificationsTemplates(TestCaseWithFactory):
     layer = DatabaseFunctionalLayer
 
     def setUp(self):
-        super(TestHasSpecificationsTemplates, self).setUp()
+        super().setUp()
         self.user = self.factory.makePerson()
         login_person(self.user)
 
@@ -249,7 +248,7 @@ class TestSpecificationsRobots(TestCaseWithFactory):
     layer = DatabaseFunctionalLayer
 
     def setUp(self):
-        super(TestSpecificationsRobots, self).setUp()
+        super().setUp()
         self.product = self.factory.makeProduct()
         self.naked_product = removeSecurityProxy(self.product)
         # Use a FakeLogger fixture to prevent Memcached warnings to be
@@ -306,7 +305,7 @@ class SpecificationSetViewTestCase(TestCaseWithFactory):
         target_widget = view.widgets['scope'].target_widget
         self.assertIsNot(
             None, content.find(True, id=target_widget.show_widget_id))
-        text = six.text_type(content)
+        text = str(content)
         picker_vocab = 'DistributionOrProductOrProjectGroup'
         self.assertIn(picker_vocab, text)
         focus_script = "setFocusByName('field.search_text')"
diff --git a/lib/lp/blueprints/browser/tests/test_views.py b/lib/lp/blueprints/browser/tests/test_views.py
index 35a2159..4d993f6 100644
--- a/lib/lp/blueprints/browser/tests/test_views.py
+++ b/lib/lp/blueprints/browser/tests/test_views.py
@@ -33,7 +33,7 @@ class TestAssignments(TestCaseWithFactory):
     layer = DatabaseFunctionalLayer
 
     def setUp(self):
-        super(TestAssignments, self).setUp()
+        super().setUp()
         # Use a FakeLogger fixture to prevent Memcached warnings to be
         # printed to stdout while browsing pages.
         self.useFixture(FakeLogger())
diff --git a/lib/lp/blueprints/errors.py b/lib/lp/blueprints/errors.py
index 6b0a4d8..2a0cfbc 100644
--- a/lib/lp/blueprints/errors.py
+++ b/lib/lp/blueprints/errors.py
@@ -19,4 +19,4 @@ class TargetAlreadyHasSpecification(Exception):
     def __init__(self, target, name):
         msg = "There is already a blueprint named %s for %s." % (
                 name, target.displayname)
-        super(TargetAlreadyHasSpecification, self).__init__(msg)
+        super().__init__(msg)
diff --git a/lib/lp/blueprints/interfaces/specification.py b/lib/lp/blueprints/interfaces/specification.py
index 739ece3..2279cad 100644
--- a/lib/lp/blueprints/interfaces/specification.py
+++ b/lib/lp/blueprints/interfaces/specification.py
@@ -761,8 +761,8 @@ class ISpecificationSet(IHasSpecifications):
     @operation_parameters(
         target=Reference(
             schema=ISpecificationTarget, required=True,
-            title=(u"The product or distribution context of this "
-                   u"specification.")))
+            title=("The product or distribution context of this "
+                   "specification.")))
     @export_factory_operation(
         ISpecification, ['name', 'title', 'specurl', 'summary',
                          'definition_status', 'assignee', 'drafter',
diff --git a/lib/lp/blueprints/interfaces/specificationmessage.py b/lib/lp/blueprints/interfaces/specificationmessage.py
index 84196d3..0148f5d 100644
--- a/lib/lp/blueprints/interfaces/specificationmessage.py
+++ b/lib/lp/blueprints/interfaces/specificationmessage.py
@@ -20,9 +20,9 @@ class ISpecificationMessage(Interface):
     """A link between a specification and a message."""
 
     specification = Reference(schema=ISpecification,
-        title=u"The specification.")
-    message = Reference(schema=IMessage, title=u"The message.")
-    visible = Bool(title=u"Is this message visible?", required=False,
+        title="The specification.")
+    message = Reference(schema=IMessage, title="The message.")
+    visible = Bool(title="Is this message visible?", required=False,
         default=True)
 
 
diff --git a/lib/lp/blueprints/model/specification.py b/lib/lp/blueprints/model/specification.py
index 8d2e21c..43f60fc 100644
--- a/lib/lp/blueprints/model/specification.py
+++ b/lib/lp/blueprints/model/specification.py
@@ -14,7 +14,6 @@ import operator
 
 from lazr.lifecycle.event import ObjectCreatedEvent
 from lazr.lifecycle.objectdelta import ObjectDelta
-import six
 from storm.locals import (
     Count,
     Desc,
@@ -801,7 +800,7 @@ class Specification(SQLBase, BugLinkTargetMixin, InformationTypeMixin):
         from lp.bugs.model.bug import Bug
         bug_ids = [
             int(id) for _, id in getUtility(IXRefSet).findFrom(
-                (u'specification', six.text_type(self.id)), types=[u'bug'])]
+                ('specification', str(self.id)), types=['bug'])]
         return list(sorted(
             bulk.load(Bug, bug_ids), key=operator.attrgetter('id')))
 
@@ -811,14 +810,12 @@ class Specification(SQLBase, BugLinkTargetMixin, InformationTypeMixin):
             props = {}
         # XXX: Should set creator.
         getUtility(IXRefSet).create(
-            {(u'specification', six.text_type(self.id)):
-                {(u'bug', six.text_type(bug.id)): props}})
+            {('specification', str(self.id)): {('bug', str(bug.id)): props}})
 
     def deleteBugLink(self, bug):
         """See BugLinkTargetMixin."""
         getUtility(IXRefSet).delete(
-            {(u'specification', six.text_type(self.id)):
-                [(u'bug', six.text_type(bug.id))]})
+            {('specification', str(self.id)): [('bug', str(bug.id))]})
 
     # sprint linking
     def linkSprint(self, sprint, user):
diff --git a/lib/lp/blueprints/model/specificationbranch.py b/lib/lp/blueprints/model/specificationbranch.py
index 9248256..462f291 100644
--- a/lib/lp/blueprints/model/specificationbranch.py
+++ b/lib/lp/blueprints/model/specificationbranch.py
@@ -47,7 +47,7 @@ class SpecificationBranch(StormBase):
     registrant = Reference(registrant_id, 'Person.id')
 
     def __init__(self, specification, branch, registrant):
-        super(SpecificationBranch, self).__init__()
+        super().__init__()
         self.specification = specification
         self.branch = branch
         self.registrant = registrant
diff --git a/lib/lp/blueprints/model/specificationsearch.py b/lib/lp/blueprints/model/specificationsearch.py
index a8404ff..10ddbb4 100644
--- a/lib/lp/blueprints/model/specificationsearch.py
+++ b/lib/lp/blueprints/model/specificationsearch.py
@@ -13,7 +13,6 @@ __all__ = [
 from collections import defaultdict
 from functools import reduce
 
-import six
 from storm.expr import (
     And,
     Coalesce,
@@ -264,7 +263,7 @@ def get_specification_filters(filter, goalstatus=True):
             SpecificationDefinitionStatus.SUPERSEDED])))
     # Filter for specification text.
     for constraint in filter:
-        if isinstance(constraint, six.string_types):
+        if isinstance(constraint, str):
             # A string in the filter is a text search filter.
             clauses.append(fti_search(Specification, constraint))
     return clauses
diff --git a/lib/lp/blueprints/model/specificationsubscription.py b/lib/lp/blueprints/model/specificationsubscription.py
index f6244e3..98e18bf 100644
--- a/lib/lp/blueprints/model/specificationsubscription.py
+++ b/lib/lp/blueprints/model/specificationsubscription.py
@@ -36,7 +36,7 @@ class SpecificationSubscription(StormBase):
     essential = Bool(allow_none=False, default=False)
 
     def __init__(self, specification, person, essential=False):
-        super(SpecificationSubscription, self).__init__()
+        super().__init__()
         self.specification = specification
         self.person = person
         self.essential = essential
diff --git a/lib/lp/blueprints/model/sprint.py b/lib/lp/blueprints/model/sprint.py
index 32607bb..ac002db 100644
--- a/lib/lp/blueprints/model/sprint.py
+++ b/lib/lp/blueprints/model/sprint.py
@@ -98,7 +98,7 @@ class Sprint(StormBase, HasDriversMixin, HasSpecificationsMixin):
     def __init__(self, owner, name, title, time_zone, time_starts, time_ends,
                  summary, address=None, driver=None, home_page=None,
                  mugshot=None, logo=None, icon=None, is_physical=True):
-        super(Sprint, self).__init__()
+        super().__init__()
         self.owner = owner
         self.name = name
         self.title = title
diff --git a/lib/lp/blueprints/model/sprintspecification.py b/lib/lp/blueprints/model/sprintspecification.py
index 9e4c9d6..1493e86 100644
--- a/lib/lp/blueprints/model/sprintspecification.py
+++ b/lib/lp/blueprints/model/sprintspecification.py
@@ -51,7 +51,7 @@ class SprintSpecification(StormBase):
     date_decided = DateTime(tzinfo=pytz.UTC, allow_none=True, default=None)
 
     def __init__(self, sprint, specification, registrant):
-        super(SprintSpecification, self).__init__()
+        super().__init__()
         self.sprint = sprint
         self.specification = specification
         self.registrant = registrant
diff --git a/lib/lp/blueprints/model/tests/test_specification.py b/lib/lp/blueprints/model/tests/test_specification.py
index e0b94bd..5de7970 100644
--- a/lib/lp/blueprints/model/tests/test_specification.py
+++ b/lib/lp/blueprints/model/tests/test_specification.py
@@ -301,7 +301,7 @@ class TestSpecificationWorkItems(TestCaseWithFactory):
     layer = DatabaseFunctionalLayer
 
     def setUp(self):
-        super(TestSpecificationWorkItems, self).setUp()
+        super().setUp()
         self.wi_header = self.factory.makeMilestone(
             name='none-milestone-as-header')
 
diff --git a/lib/lp/blueprints/model/tests/test_sprint.py b/lib/lp/blueprints/model/tests/test_sprint.py
index 1a75d75..4e6b483 100644
--- a/lib/lp/blueprints/model/tests/test_sprint.py
+++ b/lib/lp/blueprints/model/tests/test_sprint.py
@@ -35,7 +35,7 @@ class TestSpecifications(TestCaseWithFactory):
     layer = DatabaseFunctionalLayer
 
     def setUp(self):
-        super(TestSpecifications, self).setUp()
+        super().setUp()
         self.date_decided = datetime.datetime.now(utc)
 
     def makeSpec(self, sprint=None, date_decided=0, date_created=0,
diff --git a/lib/lp/blueprints/tests/test_specification.py b/lib/lp/blueprints/tests/test_specification.py
index 68198a6..9d26a6f 100644
--- a/lib/lp/blueprints/tests/test_specification.py
+++ b/lib/lp/blueprints/tests/test_specification.py
@@ -558,7 +558,7 @@ class TestSpecificationSet(TestCaseWithFactory):
     layer = DatabaseFunctionalLayer
 
     def setUp(self):
-        super(TestSpecificationSet, self).setUp()
+        super().setUp()
         self.specification_set = getUtility(ISpecificationSet)
         self.new_names = NewSpecificationDefinitionStatus.items.mapping.keys()
 
@@ -600,7 +600,7 @@ class TestSpecifications(TestCaseWithFactory):
     layer = DatabaseFunctionalLayer
 
     def setUp(self):
-        super(TestSpecifications, self).setUp()
+        super().setUp()
         self.date_created = datetime.now(pytz.utc)
 
     def makeSpec(self, product=None, date_created=0, title=None,
diff --git a/lib/lp/blueprints/tests/test_webservice.py b/lib/lp/blueprints/tests/test_webservice.py
index b0b7582..417f552 100644
--- a/lib/lp/blueprints/tests/test_webservice.py
+++ b/lib/lp/blueprints/tests/test_webservice.py
@@ -591,7 +591,7 @@ class TestSpecificationGoalHandling(TestCaseWithFactory):
     layer = DatabaseFunctionalLayer
 
     def setUp(self):
-        super(TestSpecificationGoalHandling, self).setUp()
+        super().setUp()
         self.driver = self.factory.makePerson()
         self.proposer = self.factory.makePerson()
         self.product = self.factory.makeProduct(driver=self.driver)