@@ -165,108 +165,102 @@ def _parse_config(self) -> None:
165165# Value Error means the option exists but isn't a boolean.
166166# Get as a string instead as it should then be a local path to a
167167# CA bundle.
168- try :
169- self .ssl_verify = _config .get ("global" ,"ssl_verify" )
170- except Exception :# pragma: no cover
171- pass
172- except Exception :
168+ self .ssl_verify = _config .get ("global" ,"ssl_verify" )
169+ except configparser .NoOptionError :
173170pass
174171try :
175172self .ssl_verify = _config .getboolean (self .gitlab_id ,"ssl_verify" )
176173except ValueError :
177174# Value Error means the option exists but isn't a boolean.
178175# Get as a string instead as it should then be a local path to a
179176# CA bundle.
180- try :
181- self .ssl_verify = _config .get (self .gitlab_id ,"ssl_verify" )
182- except Exception :# pragma: no cover
183- pass
184- except Exception :
177+ self .ssl_verify = _config .get (self .gitlab_id ,"ssl_verify" )
178+ except configparser .NoOptionError :
185179pass
186180
187181try :
188182self .timeout = _config .getint ("global" ,"timeout" )
189- except Exception :
183+ except configparser . NoOptionError :
190184pass
191185try :
192186self .timeout = _config .getint (self .gitlab_id ,"timeout" )
193- except Exception :
187+ except configparser . NoOptionError :
194188pass
195189
196190try :
197191self .private_token = _config .get (self .gitlab_id ,"private_token" )
198- except Exception :
192+ except configparser . NoOptionError :
199193pass
200194
201195try :
202196self .oauth_token = _config .get (self .gitlab_id ,"oauth_token" )
203- except Exception :
197+ except configparser . NoOptionError :
204198pass
205199
206200try :
207201self .job_token = _config .get (self .gitlab_id ,"job_token" )
208- except Exception :
202+ except configparser . NoOptionError :
209203pass
210204
211205try :
212206self .http_username = _config .get (self .gitlab_id ,"http_username" )
213207self .http_password = _config .get (
214208self .gitlab_id ,"http_password"
215209 )# pragma: no cover
216- except Exception :
210+ except configparser . NoOptionError :
217211pass
218212
219213self ._get_values_from_helper ()
220214
221215try :
222216self .api_version = _config .get ("global" ,"api_version" )
223- except Exception :
217+ except configparser . NoOptionError :
224218pass
225219try :
226220self .api_version = _config .get (self .gitlab_id ,"api_version" )
227- except Exception :
221+ except configparser . NoOptionError :
228222pass
229223if self .api_version not in ("4" ,):
230224raise GitlabDataError (f"Unsupported API version:{ self .api_version } " )
231225
232226for section in ["global" ,self .gitlab_id ]:
233227try :
234228self .per_page = _config .getint (section ,"per_page" )
235- except Exception :
229+ except configparser . NoOptionError :
236230pass
237231if self .per_page is not None and not 0 <= self .per_page <= 100 :
238232raise GitlabDataError (f"Unsupported per_page number:{ self .per_page } " )
239233
240234try :
241235self .pagination = _config .get (self .gitlab_id ,"pagination" )
242- except Exception :
236+ except configparser . NoOptionError :
243237pass
244238
245239try :
246240self .order_by = _config .get (self .gitlab_id ,"order_by" )
247- except Exception :
241+ except configparser . NoOptionError :
248242pass
249243
250244try :
251245self .user_agent = _config .get ("global" ,"user_agent" )
252- except Exception :
246+ except configparser . NoOptionError :
253247pass
254248try :
255249self .user_agent = _config .get (self .gitlab_id ,"user_agent" )
256- except Exception :
250+ except configparser . NoOptionError :
257251pass
258252
259253try :
260254self .retry_transient_errors = _config .getboolean (
261255"global" ,"retry_transient_errors"
262256 )
263- except Exception :
257+ except configparser . NoOptionError :
264258pass
265259try :
266260self .retry_transient_errors = _config .getboolean (
267261self .gitlab_id ,"retry_transient_errors"
268262 )
269- except Exception :
263+ except configparser . NoOptionError :
270264pass
271265
272266def _get_values_from_helper (self )-> None :