Skip to content

Commit

Permalink
fix pylint error on python 3.9
Browse files Browse the repository at this point in the history
  • Loading branch information
lpofredc committed Feb 24, 2025
1 parent 20958f6 commit 4cfc831
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 2 deletions.
6 changes: 5 additions & 1 deletion gn2pg/helpers.py
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,11 @@ def init(file: str) -> None:
"""

# Get the path to the template file
toml_src = importlib.resources.files(__package__).joinpath("data", "gn2pgconfig.toml")
toml_src = importlib.resources.files( # pylint: disable=too-many-function-args
__package__ or "gn2pg"
).joinpath( # pylint: disable=too-many-function-args
"data", "gn2pgconfig.toml"
)

toml_dst = str(ENVDIR / file)

Expand Down
6 changes: 5 additions & 1 deletion gn2pg/store_postgresql.py
Original file line number Diff line number Diff line change
Expand Up @@ -287,7 +287,11 @@ def custom_script(self, script: str = "to_gnsynthese") -> None:
logger.info(_("Start to execute %s script"), script)
conn = self._db.connect()
if script == "to_gnsynthese":
file = importlib.resources.files(__package__).joinpath("data", "to_gnsynthese.sql")
file = importlib.resources.files( # pylint: disable=too-many-function-args
__package__ or "gn2pg"
).joinpath( # pylint: disable=too-many-function-args
"data", "to_gnsynthese.sql"
)
logger.info(
_("You choosed to use internal to_gnsynthese.sql script in schema %s"),
self._db_schema,
Expand Down

0 comments on commit 4cfc831

Please sign in to comment.