mirror of
https://git.anonymousland.org/anonymousland/synapse.git
synced 2025-01-21 14:11:02 -05: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
|
# Get the nonce
|
||||||
r = requests.get(url, verify=False)
|
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))
|
_print("ERROR! Received %d %s" % (r.status_code, r.reason))
|
||||||
if 400 <= r.status_code < 500:
|
if 400 <= r.status_code < 500:
|
||||||
try:
|
try:
|
||||||
@ -84,7 +84,7 @@ def request_registration(
|
|||||||
_print("Sending registration request...")
|
_print("Sending registration request...")
|
||||||
r = requests.post(url, json=data, verify=False)
|
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))
|
_print("ERROR! Received %d %s" % (r.status_code, r.reason))
|
||||||
if 400 <= r.status_code < 500:
|
if 400 <= r.status_code < 500:
|
||||||
try:
|
try:
|
||||||
|
@ -102,7 +102,7 @@ class FederationHandler(BaseHandler):
|
|||||||
|
|
||||||
self.hs = hs
|
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.federation_client = hs.get_federation_client()
|
||||||
self.state_handler = hs.get_state_handler()
|
self.state_handler = hs.get_state_handler()
|
||||||
self.server_name = hs.hostname
|
self.server_name = hs.hostname
|
||||||
|
@ -317,7 +317,7 @@ class DataStore(RoomMemberStore, RoomStore,
|
|||||||
thirty_days_ago_in_secs))
|
thirty_days_ago_in_secs))
|
||||||
|
|
||||||
for row in txn:
|
for row in txn:
|
||||||
if row[0] is 'unknown':
|
if row[0] == 'unknown':
|
||||||
pass
|
pass
|
||||||
results[row[0]] = row[1]
|
results[row[0]] = row[1]
|
||||||
|
|
||||||
|
@ -11,7 +11,7 @@ class BackgroundUpdateTestCase(unittest.TestCase):
|
|||||||
def setUp(self):
|
def setUp(self):
|
||||||
hs = yield setup_test_homeserver(
|
hs = yield setup_test_homeserver(
|
||||||
self.addCleanup
|
self.addCleanup
|
||||||
) # type: synapse.server.HomeServer
|
)
|
||||||
self.store = hs.get_datastore()
|
self.store = hs.get_datastore()
|
||||||
self.clock = hs.get_clock()
|
self.clock = hs.get_clock()
|
||||||
|
|
||||||
|
@ -20,9 +20,6 @@ import tests.utils
|
|||||||
|
|
||||||
|
|
||||||
class EndToEndKeyStoreTestCase(tests.unittest.TestCase):
|
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
|
@defer.inlineCallbacks
|
||||||
def setUp(self):
|
def setUp(self):
|
||||||
|
@ -22,9 +22,6 @@ import tests.utils
|
|||||||
|
|
||||||
|
|
||||||
class KeyStoreTestCase(tests.unittest.TestCase):
|
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
|
@defer.inlineCallbacks
|
||||||
def setUp(self):
|
def setUp(self):
|
||||||
|
@ -28,9 +28,6 @@ logger = logging.getLogger(__name__)
|
|||||||
|
|
||||||
|
|
||||||
class StateStoreTestCase(tests.unittest.TestCase):
|
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
|
@defer.inlineCallbacks
|
||||||
def setUp(self):
|
def setUp(self):
|
||||||
|
Loading…
Reference in New Issue
Block a user