Skip to content

Commit

Permalink
EVERYWHERE reload a module, not a name
Browse files Browse the repository at this point in the history
  • Loading branch information
amochin committed Nov 6, 2023
1 parent 1c4e651 commit 7004d11
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/DatabaseLibrary/connection_manager.py
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,7 @@ def connect_to_database(
else:
self.db_api_module_name = dbapiModuleName
db_api_2 = importlib.import_module(dbapiModuleName)
db_api_2 = importlib.reload(dbapiModuleName)
db_api_2 = importlib.reload(db_api_2)

if dbapiModuleName in ["MySQLdb", "pymysql"]:
dbPort = dbPort or 3306
Expand Down Expand Up @@ -309,7 +309,7 @@ def connect_to_database_using_custom_connection_string(self, dbapiModuleName=Non
| Connect To Database Using Custom Connection String | oracledb | username/pass@localhost:1521/orclpdb" |
"""
db_api_2 = importlib.import_module(dbapiModuleName)
db_api_2 = importlib.reload(dbapiModuleName)
db_api_2 = importlib.reload(db_api_2)
self.db_api_module_name = dbapiModuleName
logger.info(
f"Executing : Connect To Database Using Custom Connection String : {dbapiModuleName}.connect('{db_connect_string}')"
Expand Down

0 comments on commit 7004d11

Please sign in to comment.