Index: gc_lang/fr/modules/conj.py ================================================================== --- gc_lang/fr/modules/conj.py +++ gc_lang/fr/modules/conj.py @@ -306,11 +306,11 @@ if self._sRawInfo[6:7] == "m": sInfo = sInfo + " impersonnel" if not sInfo: sInfo = "# erreur - code : " + self._sRawInfo return sGroup + " · " + sInfo - except: + except (IndexError, TypeError): traceback.print_exc() return "# erreur" def infinitif (self, bPro, bNeg, bTpsCo, bInt, bFem): "returns string (conjugaison à l’infinitif)" @@ -329,19 +329,19 @@ if bTpsCo: sInfi += " " + self._seekPpas(bPro, bFem, self._sRawInfo[5] == "r") if bInt: sInfi += " … ?" return sInfi - except: + except (TypeError, IndexError): traceback.print_exc() return "# erreur" def participePasse (self, sWho): "returns past participle according to " try: return self.dConj[":Q"][sWho] - except: + except KeyError: traceback.print_exc() return "# erreur" def participePresent (self, bPro, bNeg, bTpsCo, bInt, bFem): "returns string (conjugaison du participe présent)" @@ -368,11 +368,11 @@ if bTpsCo: sPartPre += " " + self._seekPpas(bPro, bFem, self._sRawInfo[5] == "r") if bInt: sPartPre += " … ?" return sPartPre - except: + except (KeyError, TypeError, IndexError): traceback.print_exc() return "# erreur" def conjugue (self, sTemps, sWho, bPro, bNeg, bTpsCo, bInt, bFem): "returns string (conjugue le verbe au temps pour ) " @@ -409,11 +409,11 @@ if bTpsCo: sConj += " " + self._seekPpas(bPro, bFem, sWho.endswith("p") or self._sRawInfo[5] == "r") if bInt: sConj += " … ?" return sConj - except: + except (KeyError, TypeError, IndexError): traceback.print_exc() return "# erreur" def _getPronomSujet (self, sWho, bFem): try: @@ -423,11 +423,11 @@ if bFem: return "elle" if sWho == ":3p" and bFem: return "elles" return _dProSuj[sWho] - except: + except (KeyError, IndexError): traceback.print_exc() return "# erreur" def imperatif (self, sWho, bPro, bNeg, bTpsCo, bFem): "returns string (conjugaison à l’impératif)" @@ -455,11 +455,11 @@ elif bPro: sImpe = sImpe + _dImpeProEn[sWho] if self.bProWithEn else sImpe + _dImpePro[sWho] if bTpsCo: return sImpe + " " + self._seekPpas(bPro, bFem, sWho.endswith("p") or self._sRawInfo[5] == "r") return sImpe - except: + except (KeyError, TypeError, IndexError): traceback.print_exc() return "# erreur" def _seekPpas (self, bPro, bFem, bPlur): try: @@ -468,11 +468,11 @@ if not bFem: return self.dConj[":Q"][":Q2"] if bPlur and self.dConj[":Q"][":Q2"] else self.dConj[":Q"][":Q1"] if not bPlur: return self.dConj[":Q"][":Q3"] if self.dConj[":Q"][":Q3"] else self.dConj[":Q"][":Q1"] return self.dConj[":Q"][":Q4"] if self.dConj[":Q"][":Q4"] else self.dConj[":Q"][":Q1"] - except: + except KeyError: traceback.print_exc() return "# erreur" def createConjTable (self, bPro=False, bNeg=False, bTpsCo=False, bInt=False, bFem=False): "return a dictionary of all conjugations with titles, according to options (used to be displayed as is)"