Bug 1530267 - Remove explicit class inheritance from `object`

Since with Python 3 all classes inherit from it by default.
This commit is contained in:
Ed Morley 2019-02-25 08:48:05 +00:00
Родитель 769cded9a8
Коммит 4704764a89
18 изменённых файлов: 20 добавлений и 20 удалений

Просмотреть файл

@ -602,7 +602,7 @@ def generic_reference_data(test_repository):
Product,
ReferenceDataSignatures)
class RefdataHolder(object):
class RefdataHolder:
pass
r = RefdataHolder()

Просмотреть файл

@ -2,7 +2,7 @@ import json
import os
class SampleData(object):
class SampleData:
@classmethod
def get_perf_data(cls, filename):

Просмотреть файл

@ -28,7 +28,7 @@ with open('treeherder/auth/jwks.json') as f:
jwks = json.load(f)
class AuthBackend(object):
class AuthBackend:
def _get_access_token_expiry(self, request):
expiration_timestamp_in_seconds = request.META.get('HTTP_ACCESS_TOKEN_EXPIRES_AT')

Просмотреть файл

@ -176,7 +176,7 @@ def crash_signature_matcher(text_log_error):
return scored_matches
class MatchScorer(object):
class MatchScorer:
"""Simple scorer for similarity of strings based on python's difflib SequenceMatcher."""
def __init__(self, target):
""":param target: The string to which candidate strings will be compared."""

Просмотреть файл

@ -10,7 +10,7 @@ __version__ = '5.0.0'
logger = logging.getLogger(__name__)
class TreeherderClient(object):
class TreeherderClient:
"""
Treeherder client class
"""

Просмотреть файл

@ -1,7 +1,7 @@
from .client import TreeherderClient
class PerformanceTimeInterval(object):
class PerformanceTimeInterval:
'''
Valid time intervals for Perfherder series
'''

Просмотреть файл

@ -23,7 +23,7 @@ def fetch_intermittent_bugs(offset, limit):
return response.get('bugs', [])
class BzApiBugProcess(object):
class BzApiBugProcess:
def run(self):
bug_list = []

Просмотреть файл

@ -15,7 +15,7 @@ from treeherder.model.models import (Push,
logger = logging.getLogger(__name__)
class JobLoader(object):
class JobLoader:
"""Validate, transform and load a list of Jobs"""
TEST_RESULT_MAP = {

Просмотреть файл

@ -13,7 +13,7 @@ env = environ.Env()
logger = logging.getLogger(__name__)
class PushLoader(object):
class PushLoader:
"""Transform and load a list of pushes"""
def process(self, message_body, exchange):
@ -62,7 +62,7 @@ class PushLoader(object):
"Unsupported push exchange: {}".format(exchange))
class GithubTransformer(object):
class GithubTransformer:
CREDENTIALS = {
"client_id": env("GITHUB_CLIENT_ID", default=None),
@ -192,7 +192,7 @@ class GithubPullRequestTransformer(GithubTransformer):
return self.fetch_push(pr_url, repository)
class HgPushTransformer(object):
class HgPushTransformer:
# {
# "root": {
# "payload": {

Просмотреть файл

@ -21,7 +21,7 @@ def last_push_id_from_server(repo):
return data['lastpushid']
class HgPushlogProcess(object):
class HgPushlogProcess:
# For more info on Mercurial Pushes, see:
# https://mozilla-version-control-tools.readthedocs.io/en/latest/hgmo/pushlog.html

Просмотреть файл

@ -21,7 +21,7 @@ from treeherder.model.models import (BugJobMap,
logger = logging.getLogger(__name__)
class Commenter(object):
class Commenter:
"""Handles fetching, composing and submitting bug comments based on
daily or weekly thresholds and date range, and updating whiteboard
and priority status as need; if in dry_run, comments will be output

Просмотреть файл

@ -10,7 +10,7 @@ from .artifactbuilders import (BuildbotJobArtifactBuilder,
MAX_DOWNLOAD_SIZE_IN_BYTES = 5 * 1024 * 1024
class ArtifactBuilderCollection(object):
class ArtifactBuilderCollection:
"""
Run a log through a collection of Artifact Builders to generate artifacts.

Просмотреть файл

@ -7,7 +7,7 @@ from .parsers import (PerformanceParser,
logger = logging.getLogger(__name__)
class ArtifactBuilderBase(object):
class ArtifactBuilderBase:
"""
Base class for all Buildbot log parsers.

Просмотреть файл

@ -9,7 +9,7 @@ from django.conf import settings
logger = logging.getLogger(__name__)
class ParserBase(object):
class ParserBase:
"""
Base class for all parsers.

Просмотреть файл

@ -74,7 +74,7 @@ def calc_t(w1, w2, weight_fn=None):
@functools.total_ordering
class RevisionDatum(object):
class RevisionDatum:
'''
This class represents a specific revision and the set of values for it
'''

Просмотреть файл

@ -19,7 +19,7 @@ from treeherder.seta.update_job_priority import update_job_priority_table
logger = logging.getLogger(__name__)
class AnalyzeFailures(object):
class AnalyzeFailures:
def __init__(self, **options):
self.dry_run = options.get('dry_run', False)

Просмотреть файл

@ -20,7 +20,7 @@ class SetaError(Exception):
pass
class SETAJobPriorities(object):
class SETAJobPriorities:
"""
SETA JobPriority Implementation
"""

Просмотреть файл

@ -11,7 +11,7 @@ from django.db.utils import (IntegrityError,
from treeherder.etl.exceptions import MissingPushException
class retryable_task(object):
class retryable_task:
"""Wrapper around a celery task to add conditional task retrying."""
NON_RETRYABLE_EXCEPTIONS = (