mirror of
https://github.com/pgadmin-org/pgadmin4.git
synced 2025-02-25 18:55:31 -06:00
Fixed code smell 'Unused local variables should be removed'.
This commit is contained in:
committed by
Akshay Joshi
parent
1fbf298d30
commit
dd27e08a98
@@ -718,7 +718,7 @@ def utils():
|
||||
from pgadmin.utils.driver import get_driver
|
||||
driver = get_driver(PG_DEFAULT_DRIVER)
|
||||
pg_libpq_version = driver.libpq_version()
|
||||
except Exception as e:
|
||||
except Exception:
|
||||
pg_libpq_version = 0
|
||||
|
||||
for submodule in current_blueprint.submodules:
|
||||
|
||||
@@ -232,7 +232,6 @@ class DatabaseView(PGChildNodeView):
|
||||
if self.manager.db == row['name']:
|
||||
row['canDrop'] = False
|
||||
else:
|
||||
conn = self.manager.connection(row['name'], did=row['did'])
|
||||
row['canDrop'] = True
|
||||
|
||||
return ajax_response(
|
||||
|
||||
@@ -428,7 +428,7 @@ class PGChildNodeView(NodeView):
|
||||
return internal_server_error(errormsg=msg)
|
||||
except (ConnectionLost, SSHTunnelConnectionLost, CryptKeyMissing):
|
||||
raise
|
||||
except Exception as e:
|
||||
except Exception:
|
||||
return precondition_required(
|
||||
gettext(
|
||||
"Connection to the server has been lost."
|
||||
|
||||
@@ -104,7 +104,7 @@ class PGUtilitiesBackupFeatureTest(BaseFeatureTest):
|
||||
lambda driver: driver.find_element_by_name(
|
||||
NavMenuLocators.backup_filename_txt_box_name)):
|
||||
click = False
|
||||
except Exception as e:
|
||||
except Exception:
|
||||
pass
|
||||
|
||||
# Wait for the backup status alertfier
|
||||
|
||||
@@ -674,7 +674,7 @@ SELECT 1, pg_sleep(300)"""
|
||||
show_jit = pg_cursor.fetchone()
|
||||
if show_jit[0] == 'on':
|
||||
jit_enabled = True
|
||||
except Exception as e:
|
||||
except Exception:
|
||||
pass
|
||||
|
||||
connection.close()
|
||||
|
||||
@@ -314,7 +314,7 @@ class CheckForXssFeatureTest(BaseFeatureTest):
|
||||
)
|
||||
).perform()
|
||||
break
|
||||
except Exception as e:
|
||||
except Exception:
|
||||
if idx != 2:
|
||||
continue
|
||||
else:
|
||||
|
||||
@@ -88,7 +88,7 @@ class CheckDebuggerForXssFeatureTest(BaseFeatureTest):
|
||||
"contains(@class,'ajs-header')]")
|
||||
))
|
||||
|
||||
except TimeoutException as e:
|
||||
except TimeoutException:
|
||||
is_error = None
|
||||
|
||||
# If debugger plugin is not found
|
||||
|
||||
@@ -485,7 +485,7 @@ def register_dialect(name, dialect='excel', **fmtparams):
|
||||
|
||||
try:
|
||||
Dialect.validate(dialect)
|
||||
except Exception as e:
|
||||
except Exception:
|
||||
raise TypeError('dialect is invalid')
|
||||
|
||||
assert name not in _dialect_registry
|
||||
|
||||
@@ -49,7 +49,7 @@ class AppStarter:
|
||||
random_server_port
|
||||
)
|
||||
|
||||
except WebDriverException as e:
|
||||
except WebDriverException:
|
||||
# In case of WebDriverException sleep for 1 second and retry
|
||||
# again. Retry 10 times and if still app will not start then
|
||||
# raise exception.
|
||||
|
||||
@@ -1020,7 +1020,7 @@ class PgadminPage:
|
||||
WebDriverWait(self.driver, timeout, .01).until(
|
||||
EC.visibility_of_element_located((By.XPATH, xpath)))
|
||||
element_found = True
|
||||
except Exception as e:
|
||||
except Exception:
|
||||
pass
|
||||
return element_found
|
||||
|
||||
@@ -1141,7 +1141,7 @@ class PgadminPage:
|
||||
EC.visibility_of_any_elements_located((
|
||||
By.XPATH, locator))):
|
||||
elements_located_status = True
|
||||
except Exception as e:
|
||||
except Exception:
|
||||
pass
|
||||
return elements_located_status
|
||||
|
||||
|
||||
@@ -1331,6 +1331,7 @@ def launch_url_in_browser(driver_instance, url, title='pgAdmin 4', timeout=50):
|
||||
time.sleep(6)
|
||||
count -= 1
|
||||
if count == 0:
|
||||
print(str(e))
|
||||
exception_msg = 'Web-page title did not match to {0}. ' \
|
||||
'Please check url {1} accessible on ' \
|
||||
'internet.'.format(title, url)
|
||||
@@ -1475,7 +1476,7 @@ def get_selenium_grid_status_json(selenoid_url):
|
||||
selenoid_status = json.load(selenoid_status)
|
||||
if isinstance(selenoid_status, dict):
|
||||
return selenoid_status
|
||||
except Exception as e:
|
||||
except Exception:
|
||||
print("Unable to find Selenoid Status.Kindly check url passed -'{0}'."
|
||||
"Check parsing errors in test_config.json".format(selenoid_url))
|
||||
return None
|
||||
|
||||
Reference in New Issue
Block a user