mirror of
https://mau.dev/maunium/synapse.git
synced 2024-10-01 01:36:05 -04:00
Fix flake8 (#4519)
This commit is contained in:
parent
457fbfaf22
commit
3f189c902e
1
changelog.d/4519.misc
Normal file
1
changelog.d/4519.misc
Normal file
@ -0,0 +1 @@
|
||||
Fix code to comply with linting in PyFlakes 3.7.1.
|
@ -46,7 +46,7 @@ def request_registration(
|
||||
# Get the nonce
|
||||
r = requests.get(url, verify=False)
|
||||
|
||||
if r.status_code is not 200:
|
||||
if r.status_code != 200:
|
||||
_print("ERROR! Received %d %s" % (r.status_code, r.reason))
|
||||
if 400 <= r.status_code < 500:
|
||||
try:
|
||||
@ -84,7 +84,7 @@ def request_registration(
|
||||
_print("Sending registration request...")
|
||||
r = requests.post(url, json=data, verify=False)
|
||||
|
||||
if r.status_code is not 200:
|
||||
if r.status_code != 200:
|
||||
_print("ERROR! Received %d %s" % (r.status_code, r.reason))
|
||||
if 400 <= r.status_code < 500:
|
||||
try:
|
||||
|
@ -102,7 +102,7 @@ class FederationHandler(BaseHandler):
|
||||
|
||||
self.hs = hs
|
||||
|
||||
self.store = hs.get_datastore() # type: synapse.storage.DataStore
|
||||
self.store = hs.get_datastore()
|
||||
self.federation_client = hs.get_federation_client()
|
||||
self.state_handler = hs.get_state_handler()
|
||||
self.server_name = hs.hostname
|
||||
|
@ -317,7 +317,7 @@ class DataStore(RoomMemberStore, RoomStore,
|
||||
thirty_days_ago_in_secs))
|
||||
|
||||
for row in txn:
|
||||
if row[0] is 'unknown':
|
||||
if row[0] == 'unknown':
|
||||
pass
|
||||
results[row[0]] = row[1]
|
||||
|
||||
|
@ -11,7 +11,7 @@ class BackgroundUpdateTestCase(unittest.TestCase):
|
||||
def setUp(self):
|
||||
hs = yield setup_test_homeserver(
|
||||
self.addCleanup
|
||||
) # type: synapse.server.HomeServer
|
||||
)
|
||||
self.store = hs.get_datastore()
|
||||
self.clock = hs.get_clock()
|
||||
|
||||
|
@ -20,9 +20,6 @@ import tests.utils
|
||||
|
||||
|
||||
class EndToEndKeyStoreTestCase(tests.unittest.TestCase):
|
||||
def __init__(self, *args, **kwargs):
|
||||
super(EndToEndKeyStoreTestCase, self).__init__(*args, **kwargs)
|
||||
self.store = None # type: synapse.storage.DataStore
|
||||
|
||||
@defer.inlineCallbacks
|
||||
def setUp(self):
|
||||
|
@ -22,9 +22,6 @@ import tests.utils
|
||||
|
||||
|
||||
class KeyStoreTestCase(tests.unittest.TestCase):
|
||||
def __init__(self, *args, **kwargs):
|
||||
super(KeyStoreTestCase, self).__init__(*args, **kwargs)
|
||||
self.store = None # type: synapse.storage.keys.KeyStore
|
||||
|
||||
@defer.inlineCallbacks
|
||||
def setUp(self):
|
||||
|
@ -28,9 +28,6 @@ logger = logging.getLogger(__name__)
|
||||
|
||||
|
||||
class StateStoreTestCase(tests.unittest.TestCase):
|
||||
def __init__(self, *args, **kwargs):
|
||||
super(StateStoreTestCase, self).__init__(*args, **kwargs)
|
||||
self.store = None # type: synapse.storage.DataStore
|
||||
|
||||
@defer.inlineCallbacks
|
||||
def setUp(self):
|
||||
|
Loading…
Reference in New Issue
Block a user