Skip to content

Commit 1c74f9c

Browse files
committed
Fix B101: assert_used
1 parent 5733baf commit 1c74f9c

2 files changed

Lines changed: 5 additions & 2 deletions

File tree

lizmap/plugin/baselayers.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -78,7 +78,9 @@ def initialize_base_layers(self):
7878

7979
def check_visibility_crs_3857(self):
8080
version = self.current_lwc_version()
81-
assert version is not None
81+
if version is None:
82+
raise AssertionError('Current Lizmap Web Client is unknown')
83+
8284
check_visibility_crs_3857(
8385
self.dlg,
8486
self.crs_3857_base_layers_list,

lizmap/server_dav.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -154,7 +154,8 @@ def setup_webdav_dialog(self, dialog: LizmapDialog = None) -> bool:
154154
if dialog:
155155
self.parent = dialog
156156

157-
assert self.parent
157+
if not self.parent:
158+
raise AssertionError("No parent dialog set")
158159

159160
self.config_project()
160161

0 commit comments

Comments
 (0)