Changeset 4186

Show
Ignore:
Timestamp:
06/26/08 06:13:13 (5 months ago)
Author:
ed
Message:

Removed bare 'except:' lines.

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • trunk/dabo/ui/__init__.py

    r3810 r4186  
    175175        ret = None 
    176176        for att in self.__class__._proxyDict[nm]: 
    177             try: 
    178                 if att == "self": 
    179                     base = getattr(self, "_baseClass", self.__class__) 
    180                     obj = base.__bases__[0] 
    181                     prop = getattr(obj, nm) 
    182                     ret = prop.fget(self) 
    183                 else: 
    184                     obj = getattr(self, att) 
    185                     ret = getattr(obj, nm) 
    186                 break 
    187             except: 
    188                 continue 
     177            if att == "self": 
     178                base = getattr(self, "_baseClass", self.__class__) 
     179                obj = base.__bases__[0] 
     180                prop = getattr(obj, nm) 
     181                ret = prop.fget(self) 
     182            else: 
     183                obj = getattr(self, att) 
     184                ret = getattr(obj, nm) 
     185            break 
    189186        return ret 
    190187     
  • trunk/dabo/ui/uiwx/__init__.py

    r4172 r4186  
    148148try: 
    149149    from dLinePlot import dLinePlot 
    150 except
     150except ImportError
    151151    pass 
    152152 
     
    334334            # for insertion into the dEvent.EventData dict. 
    335335            d = dir(wxEvt) 
    336             try: 
    337                 upPems = [p for p in d if p[0].isupper()] 
    338                 for pem in upPems: 
    339                     if pem in ("Skip", "Clone", "Destroy", "Button", "ButtonIsDown", 
    340                             "GetLogicalPosition", "ResumePropagation", "SetEventObject", 
    341                             "SetEventType", "SetId", "SetExtraLong", "SetInt", "SetString", 
    342                             "SetTimestamp", "StopPropagation"): 
    343                         continue 
    344                     try: 
    345                         pemName = pem[0].lower() + pem[1:] 
    346                         ed[pemName] = eval("wxEvt.%s()" % pem) 
    347                     except: 
    348                         pass 
    349             except: 
    350                 pass 
     336            upPems = [p for p in d if p[0].isupper()] 
     337            for pem in upPems: 
     338                if pem in ("Skip", "Clone", "Destroy", "Button", "ButtonIsDown", 
     339                        "GetLogicalPosition", "ResumePropagation", "SetEventObject", 
     340                        "SetEventType", "SetId", "SetExtraLong", "SetInt", "SetString", 
     341                        "SetTimestamp", "StopPropagation"): 
     342                    continue 
     343                try: 
     344                    pemName = pem[0].lower() + pem[1:] 
     345                    ed[pemName] = eval("wxEvt.%s()" % pem) 
     346                except AttributeError: 
     347                    pass 
    351348 
    352349    if isinstance(wxEvt, (wx.SplitterEvent,) ): 
    353350        try: 
    354351            ed["mousePosition"] = (wxEvt.GetX(), wxEvt.GetY()) 
    355         except
     352        except AttributeError
    356353            ed["mousePosition"] = wx.GetMousePosition() 
    357354 
     
    378375        try: 
    379376            ed["col"] = wxEvt.GetColumn() 
    380         except
     377        except AttributeError
    381378            pass 
    382379 
     
    395392        try: 
    396393            ed["mousePosition"] = wxEvt.GetPoint().Get() 
    397         except: pass 
     394        except AttributeError: 
     395            pass 
    398396        # See if it's a menu selection 
    399397        obj = wxEvt.GetEventObject() 
     
    450448            ed["itemID"] = wxEvt.GetItem() 
    451449            ed["itemNode"] = tree.find(ed["itemID"])[0] 
    452         except
     450        except (AttributeError, IndexError)
    453451            pass 
    454452 
     
    456454        try: 
    457455            ed["sashPosition"] = wxEvt.GetSashPosition() 
    458         except
     456        except AttributeError
    459457            ed["sashPosition"] = wxEvt.GetEventObject().SashPosition 
    460458        if wxEvt.GetEventType() == wx.EVT_SPLITTER_UNSPLIT.evtType[0]: 
    461459            try: 
    462460                ed["windowRemoved"] = wxEvt.GetWindowBeingRemoved() 
    463             except
     461            except AttributeError
    464462                ed["windowRemoved"] = None 
    465463 
     
    485483            # Don't think this is implemented yet 
    486484            ed["commandDown"] = wxEvt.CmdDown() 
    487         except: pass 
     485        except AttributeError: 
     486            pass 
    488487 
    489488    if isinstance(wxEvt, wx.grid.GridSizeEvent): 
     
    501500            # Don't think this is implemented yet 
    502501            ed["commandDown"] = wxEvt.CmdDown() 
    503         except: pass 
     502        except AttributeError: 
     503            pass 
    504504 
    505505    if isinstance(wxEvt, wx.calendar.CalendarEvent): 
     
    517517        if isinstance(wxEvt, wx.html.HtmlLinkEvent): 
    518518            ed["href"] = wxEvt.href 
    519     except
     519    except AttributeError
    520520        # wxPython 2.6 and earlier doesn't seem to have this event 
    521521        pass 
     
    831831    try: 
    832832        mm, dd, yy = dt.month, dt.day, dt.year 
    833     except
     833    except AttributeError
    834834        dabo.errorLog.write(_("Invalid date value passed to getDate(): %s") % dt) 
    835835        return None 
     
    12131213            try: 
    12141214                cap = "Browse: %s" % dataSource.Table 
    1215             except
     1215            except AttributeError
    12161216                cap = "Browse" 
    12171217        else: 
     
    13061306        try: 
    13071307            txt = wind.Caption 
    1308         except
     1308        except AttributeError
    13091309            raise ValueError, "No text supplied to fontMetric call" 
    13101310    fnt = wind.GetFont() 
     
    13211321        try: 
    13221322            wind = wind.Form 
    1323         except
     1323        except AttributeError
    13241324            try: 
    13251325                wind = wind.Parent 
    1326             except
     1326            except AttributeError
    13271327                pass 
    13281328    dc = wx.ClientDC(wind) 
  • trunk/dabo/ui/uiwx/concordance.py

    r3054 r4186  
    1515        for mro in daboClass.__mro__: 
    1616            if "<class 'wx." in str(mro): 
    17                 try: 
    18                     if "wx._" in str(mro): 
    19                         # normal wx class: don't include the wx._controls. cruft 
    20                         dabo_to_wx[daboName] = "wx.%s" % str(mro).split(".")[-1][:-2] 
    21                     else: 
    22                         # extra class: give the full story: 
    23                         dabo_to_wx[daboName] = str(mro)[8:-2]  
    24                 except: 
    25                     pass 
     17                if "wx._" in str(mro): 
     18                    # normal wx class: don't include the wx._controls. cruft 
     19                    dabo_to_wx[daboName] = "wx.%s" % str(mro).split(".")[-1][:-2] 
     20                else: 
     21                    # extra class: give the full story: 
     22                    dabo_to_wx[daboName] = str(mro)[8:-2]  
    2623                break 
    2724 
  • trunk/dabo/ui/uiwx/dBorderSizer.py

    r3303 r4186  
    2424            box, orientation = orientation, box 
    2525        if not isinstance(box, dabo.ui.dBox): 
    26             try: 
    27                 prnt = box 
    28                 box = dabo.ui.dBox(prnt) 
    29                 box.sendToBack() 
    30             except: 
    31                 raise dException.dException, "Must pass an instance of dBox or a parent object to dBorderSizer" 
     26            prnt = box 
     27            box = dabo.ui.dBox(prnt) 
     28            box.sendToBack() 
    3229        # Convert Dabo orientation to wx orientation 
    3330        orient = self._extractKey((kwargs, properties), "Orientation", orientation) 
  • trunk/dabo/ui/uiwx/dButton.py

    r3303 r4186  
    9999                    try: 
    100100                        db = child.DefaultButton 
    101                     except
     101                    except AttributeError
    102102                        db = False 
    103103                    if db: 
  • trunk/dabo/ui/uiwx/dCheckBox.py

    r3980 r4186  
    9393            try: 
    9494                state = self._ValueTo3State[val] 
    95             except
     95            except KeyError
    9696                state = False 
    9797            self.Set3StateValue(state) 
  • trunk/dabo/ui/uiwx/dColorDialog.py

    r3054 r4186  
    1919                    color = dColors.colorTupleFromName(color) 
    2020                    dat.SetColour(color) 
    21                 except: pass 
     21                except KeyError: 
     22                    pass 
    2223            elif isinstance(color, tuple): 
    2324                dat.SetColour(color) 
  • trunk/dabo/ui/uiwx/dControlItemMixin.py

    r4134 r4186  
    222222                    try: 
    223223                        self.setSelection(self.Keys.index(key)) 
    224                     except
     224                    except IndexError
    225225                        # No such key; write an info message, but otherwise ignore it. 
    226226                        dabo.infoLog.write(_("Key '%s' not found") % key) 
     
    259259                try: 
    260260                    self._setSelection(index) 
    261                 except: pass 
     261                except IndexError: 
     262                    pass 
    262263            self._afterValueChanged() 
    263264        else: 
     
    308309            try: 
    309310                strings.append(self.GetString(index)) 
    310             except
     311            except IndexError
    311312                # If this is a list control, there is no native GetString. 
    312313                # Use the Dabo-supplied replacement 
    313314                try: 
    314315                    strings.append(self._GetString(index)) 
    315                 except
     316                except IndexError
    316317                    # Invalid index; usually an empty list 
    317318                    pass 
  • trunk/dabo/ui/uiwx/dControlMixin.py

    r3998 r4186  
    2222        # Hide a problem on Windows toolbars where a single command event will 
    2323        # be raised up to three separate times. 
     24#       print "CONTROL WXHIT", self, evt 
    2425        now = time.time() 
    2526        if not hasattr(self, "_lastHitTime") or (now - self._lastHitTime) > .001: 
    2627            self.raiseEvent(dEvents.Hit, evt, *args, **kwargs) 
     28#           print "CONTROL RAISING HIT" 
    2729            self._lastHitTime = time.time() 
    2830         
  • trunk/dabo/ui/uiwx/dDateTextBox.py

    r3954 r4186  
    125125        try: 
    126126            self.calPanel.cal.Date = self.Value 
    127         except
     127        except AttributeError
    128128            self.calPanel = CalPanel(self.Parent, dt=self.Value, ctrl=self) 
    129129        cp = self.calPanel 
     
    159159                else: 
    160160                    key = {8: "h", 13: "m", 19: "s"}[evt.keyCode] 
    161         except
     161        except KeyError
    162162            # spurious key event; ignore 
    163163            return 
     
    207207            if newVal != val: 
    208208                self.Value = newVal 
    209         except: pass 
     209        except ValueError: 
     210            pass 
    210211         
    211212 
     
    368369                self.Value = self.Value.replace(year=yr, month=mn, day=dy) 
    369370                ok = True 
    370             except
     371            except ValueError
    371372                dy -= 1 
    372373     
  • trunk/dabo/ui/uiwx/dDialog.py

    r4170 r4186  
    121121        """ 
    122122        if self.Application is not None: 
    123             try: 
    124                 self.Application.uiForms.remove(self) 
    125             except: pass 
     123            self.Application.uiForms.remove(self) 
    126124        super(dDialog, self).release() 
    127125     
  • trunk/dabo/ui/uiwx/dDockForm.py

    r4079 r4186  
    254254        try: 
    255255            return self._caption 
    256         except
     256        except AttributeError
    257257            self._caption = "" 
    258258            return self._caption 
  • trunk/dabo/ui/uiwx/dEditor.py

    r4152 r4186  
    514514        number. If the position is invalid, returns -1. 
    515515        """ 
    516         try: 
    517             ret = self.LineFromPosition(pos) 
    518         except: 
    519             ret = -1 
    520         return ret 
    521      
    522      
     516        return self.LineFromPosition(pos) 
     517 
     518 
    523519    def getPositionFromLine(self, linenum): 
    524520        """Given a line number, returns the position of the start of that line. 
    525521        If the line number is invalid, returns -1.""" 
    526         try: 
    527             ret = self.PositionFromLine(linenum) 
    528         except: 
    529             ret = -1 
    530         return ret 
     522        return self.PositionFromLine(linenum) 
    531523 
    532524 
     
    828820                try: 
    829821                    newSize = int(fontSize) 
    830                 except
     822                except ValueError
    831823                    dabo.errorLog.write(_("Invalid value passed to changeFontSize: %s") % fontSize) 
    832824                    return 
     
    11691161                    del args[0][0] 
    11701162                args = inspect.formatargspec(args[0], args[1], args[2], args[3]) 
    1171             except
     1163            except IndexError
    11721164                args = "" 
    11731165 
    1174             try: 
    1175                 if inspect.ismethod(obj): 
    1176                     funcType = "Method" 
    1177                 elif inspect.isfunction(obj): 
    1178                     funcType = "Function" 
    1179                 elif inspect.isclass(obj): 
    1180                     funcType = "Class" 
    1181                 elif inspect.ismodule(obj): 
    1182                     funcType = "Module" 
    1183                 elif inspect.isbuiltin(): 
    1184                     funcType = "Built-In" 
    1185                 else: 
    1186                     funcType = "" 
    1187             except: 
     1166            if inspect.ismethod(obj): 
     1167                funcType = "Method" 
     1168            elif inspect.isfunction(obj): 
     1169                funcType = "Function" 
     1170            elif inspect.isclass(obj): 
     1171                funcType = "Class" 
     1172            elif inspect.ismodule(obj): 
     1173                funcType = "Module" 
     1174            elif inspect.isbuiltin(): 
     1175                funcType = "Built-In" 
     1176            else: 
    11881177                funcType = "" 
    11891178 
    11901179            doc = "" 
    1191             try: 
    1192                 docLines = obj.__doc__.splitlines() 
    1193                 for line in docLines: 
    1194                     doc += line.strip() + "\n"   ## must be \n on all platforms 
    1195                 doc = doc.strip()  ## Remove trailing blank line 
    1196             except: 
    1197                 pass 
     1180            docLines = obj.__doc__.splitlines() 
     1181            for line in docLines: 
     1182                doc += line.strip() + "\n"   ## must be \n on all platforms 
     1183            doc = doc.strip()  ## Remove trailing blank line 
    11981184 
    11991185            try: 
    12001186                name = obj.__name__ 
    1201             except
     1187            except AttributeError
    12021188                name = "" 
    12031189                 
    1204             shortDoc = "%s %s%s" % (funcType, 
    1205                 name, 
    1206                 args) 
    1207  
     1190            shortDoc = "%s %s%s" % (funcType, name, args) 
    12081191            longDoc = "%s\n\n%s" % (shortDoc, doc) 
    12091192             
     
    13451328        try: 
    13461329            fname = self._fileName 
    1347         except
     1330        except AttributeError
    13481331            fname = None 
    13491332        if fname is None or fname is "": 
     
    13601343            try: 
    13611344                drct = self._curdir 
    1362             except
     1345            except AttributeError
    13631346                drct = "" 
    13641347        else: 
     
    14071390            try: 
    14081391                fname = self._fileName 
    1409             except
     1392            except AttributeError
    14101393                fname = self._newFileName 
    14111394         
     
    14191402        try: 
    14201403            open(fname, "wb").write(self.GetText().encode(self.Encoding)) 
    1421         except
     1404        except OSError
    14221405            dabo.ui.stop("Could not save %s. Please check your write permissions." % fname) 
    14231406            return False 
     
    15171500                text = f.read().decode(self.Encoding) 
    15181501                f.close() 
    1519             except
     1502            except OSError
    15201503                if os.path.exists(fileSpec): 
    15211504                    dabo.ui.stop("Could not open %s.  Please check that you have read permissions." % fileSpec) 
     
    16331616                    for attr in dir(obj): 
    16341617                        attr = '%s%s'%(word,attr) 
    1635                         if attr not in words: words.append(attr) 
    1636             except: 
     1618                        if attr not in words: 
     1619                                words.append(attr) 
     1620            except IndexError: 
    16371621                pass 
    16381622        elif word[-1] in " ()[]{}": 
     
    16411625        if words: 
    16421626            words.sort(lambda a,b: cmp(a.upper(), b.upper())) 
    1643             try: 
    1644                 # For some reason, the STC editor in Windows likes to add icons 
    1645                 # even if they aren't requested. This explicitly removes them. 
    1646                 wds = ["%s?0" % wd for wd in words]              
    1647                 self.AutoCompShow(len(word), " ".join(wds)) 
    1648             except: 
    1649                 pass 
     1627            # For some reason, the STC editor in Windows likes to add icons 
     1628            # even if they aren't requested. This explicitly removes them. 
     1629            wds = ["%s?0" % wd for wd in words]              
     1630            self.AutoCompShow(len(word), " ".join(wds)) 
    16501631 
    16511632     
     
    16891670    def getWordObject(self,word=None,whole=None): 
    16901671        if not word: word=self.getWord(whole=whole) 
    1691         try: 
    1692             obj = self.evaluate(word) 
    1693             return obj 
    1694         except: 
    1695             return None 
     1672        return self.evaluate(word) 
    16961673    # End of auto-completion code 
    16971674    # - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 
     
    17931770                try: 
    17941771                    o = eval("o.%s" % innerObjectNames) 
    1795                 except
     1772                except AttributeError
    17961773                    o = None 
    17971774        return o 
     
    20632040            self._selectionBackColor = val 
    20642041            if isinstance(val, basestring): 
    2065                 try: 
    2066                     val = dColors.colorTupleFromName(val) 
    2067                 except: pass 
     2042                val = dColors.colorTupleFromName(val) 
    20682043            self.SetSelBackground(1, val) 
    20692044        else: 
     
    20882063            self._selectionForeColor = val 
    20892064            if isinstance(val, basestring): 
    2090                 try: 
    2091                     val = dColors.colorTupleFromName(val) 
    2092                 except: pass 
     2065                val = dColors.colorTupleFromName(val) 
    20932066            self.SetSelForeground(1, val) 
    20942067        else: 
  • trunk/dabo/ui/uiwx/dFoldPanelBar.py

    r3305 r4186  
    106106            # Call the Dabo version, if present 
    107107            self.Sizer.layout() 
    108         except
     108        except AttributeError
    109109            pass 
    110110        if self.Application.Platform == "Win": 
  • trunk/dabo/ui/uiwx/dFont.py

    r3638 r4186  
    5656                try: 
    5757                    return self._nativeFont.SetFaceName(val) 
    58                 except
     58                except AttributeError
    5959                    return False 
    6060            return False 
     
    110110        try: 
    111111            self._nativeFont.SetPointSize(val) 
    112         except
     112        except ValueError
    113113            dabo.errorLog.write(_("Setting FontSize to %s failed") % val) 
    114114        self._propsChanged() 
  • trunk/dabo/ui/uiwx/dForm.py

    r4022 r4186  
    716716            # This is being called by a regular grid not tied to a bizobj 
    717717            rowCount = grid.RowCount 
    718             rowNumber = grid.CurrentRow+
     718            rowNumber = grid.CurrentRow +
    719719        else: 
    720720            bizobj = self.getBizobj(dataSource) 
     
    724724                    # store these directly, since they lack bizobjs 
    725725                    rowCount = self.rowCount 
    726                     rowNumber = self.rowNumber+
    727                 except
     726                    rowNumber = self.rowNumber +
     727                except AttributeError
    728728                    rowCount = 1 
    729729                    rowNumber = 1 
  • trunk/dabo/ui/uiwx/dFormMixin.py

    r4139 r4186  
    162162                try: 
    163163                    restoredSP = self.restoredSP 
    164                 except
     164                except AttributeError
    165165                    restoredSP = False 
    166166                if not restoredSP: 
     
    195195        try: 
    196196            restoredSP = self.restoredSP 
    197         except
     197        except AttributeError
    198198            restoredSP = False 
    199199        if restoredSP:       
     
    204204        try: 
    205205            restoredSP = self.restoredSP 
    206         except
     206        except AttributeError
    207207            restoredSP = False 
    208208        if restoredSP: 
     
    248248 
    249249        if app is not None: 
    250             try: 
    251                 self.Application.uiForms.remove(self) 
    252             except: pass 
    253      
    254      
     250            self.Application.uiForms.remove(self) 
     251 
     252 
    255253    def activeControlValid(self): 
    256254        """ Force the control-with-focus to fire its KillFocus code. 
     
    495493            # Call the Dabo version, if present 
    496494            self.Sizer.layout() 
    497         except: pass 
     495        except AttributeError: 
     496            pass 
    498497        if self.Application.Platform == "Win": 
    499498            self.refresh() 
     
    568567 
    569568 
    570     def pushStatusText(self, txt): 
     569    def pushStatusText(self, txt, duration=None): 
    571570        """Stores the current text of the StatusBar on a LIFO stack for later retrieval.""" 
    572571        self._statusStack.append(self.StatusText) 
    573572        self.StatusText = txt 
     573        if duration is not None: 
     574            # Pop it after 'duration' seconds 
     575            dabo.ui.callAfterInterval(1000*duration, self.popStatusText) 
    574576 
    575577 
     
    858860            try: 
    859861                ret = self.GetStatusBar() 
    860             except
     862            except AttributeError
    861863                # pkm: My client got a TypeError from the wx layer, perhaps because the 
    862864                #      window is a dialog and not a form, but I can't reproduce on my end. 
  • trunk/dabo/ui/uiwx/dGrid.py

    r4129 r4186  
    113113        try: 
    114114            return self.grid.RowLabels[row] 
    115         except
     115        except IndexError
    116116            return "" 
    117117 
     
    160160                try: 
    161161                    col.DataType = typeDict[col.DataType] 
    162                 except
     162                except KeyError
    163163                    # Not one of the standard types. Extract it from 
    164164                    # the string version of the type 
    165165                    try: 
    166166                        col.DataType = str(col.DataType).split("'")[1].lower() 
    167                     except
     167                    except IndexError
    168168                        # Something's odd. Print an error message and move on. 
    169169                        dabo.errorLog.write("Unknown data type found in setColumns(): %s" 
     
    322322                    ret = not self.grid.DataSet[row][field] 
    323323                return ret 
    324             except: pass 
     324            except (IndexError, KeyError): 
     325                pass 
    325326            return ret 
    326327        return True 
     
    343344            try: 
    344345                ret = self.grid.DataSet[row][field] 
    345             except
     346            except (IndexError, KeyError)
    346347                ret = "" 
    347348        if ret is None: 
     
    570571                try: 
    571572                    oldVal = getattr(self, prop) 
    572                 except
     573                except AttributeError
    573574                    needRefresh = True 
    574575                setattr(self, prop, func(*args, **kwargs)) 
     
    603604        line with other Dabo objects. 
    604605        """ 
    605         try: 
    606             self.Parent.removeColumn(self) 
    607         except: 
    608             pass 
     606        self.Parent.removeColumn(self) 
    609607 
    610608 
     
    751749        try: 
    752750            grid = self.Parent 
    753         except
     751        except AttributeError
    754752            grid = None 
    755753        if grid is not None: 
     
    12621260        try: 
    12631261            v = self._listEditorChoices 
    1264         except
     1262        except AttributeError
    12651263            v = [] 
    12661264        return v 
     
    13111309        try: 
    13121310            v = self._searchable 
    1313         except
     1311        except AttributeError
    13141312            v = self._searchable = True 
    13151313        return v 
     
    13251323        try: 
    13261324            v = self._sortable 
    1327         except
     1325        except At
    13281326            v = self._sortable = True 
    13291327        return v 
     
    13851383            try: 
    13861384                self.Parent.SetColSize(idx, v) 
    1387             except
     1385            except AttributeError
    13881386                # The grid may still be in the process of being created, so pass. 
    13891387                pass 
     
    18791877        try: 
    18801878            ret = self._Table.GetValue(row, col) 
    1881         except
     1879        except AttributeError
    18821880            ret = super(dGrid, self).GetCellValue(row, col) 
    18831881        return ret 
     
    18871885        try: 
    18881886            ret = self._Table.GetValue(row, col) 
    1889         except
     1887        except AttributeError
    18901888            ret = super(dGrid, self).GetValue(row, col) 
    18911889        return ret 
     
    21162114                try: 
    21172115                    structure = bizobj.getDataStructureFromDescription() 
    2118                 except
     2116                except TypeError
    21192117                    # Well, that call failed... seems that sqlite doesn't define a cursor 
    21202118                    # description? I need to test this out. For now, fall back to the old 
     
    21402138            try: 
    21412139                cap = keyCaption[colKey] 
    2142             except
     2140            except KeyError
    21432141                cap = colKey 
    21442142            col = self.addColumn(inBatch=True) 
     
    22662264        try: 
    22672265            self.AutoSizeColumn(colNum, setAsMin=False) 
    2268         except
     2266        except wx.PyAssertionError
    22692267            pass 
    22702268        _setColSize(colNum) 
     
    29362934                ## yet it hasn't yet taken effect: force it. 
    29372935                col.Width = col.Width 
    2938         except
     2936        except wx.PyAssertionError
    29392937            # If the underlying wx grid doesn't yet know about the column, such 
    29402938            # as when adding columns with inBatch=True, this can throw an error 
     
    33003298        try: 
    33013299            col = self.Columns[newCol] 
    3302         except
     3300        except IndexError
    33033301            col = None 
    33043302 
     
    35083506        except AttributeError: 
    35093507            left = right = evt.GetCol() 
    3510         try: 
    3511             if mode == wx.grid.Grid.wxGridSelectRows: 
    3512                 if (top != bott) or (top != origCol): 
    3513                     # Attempting to select a range 
    3514                     if top == origRow: 
    3515                         row = bott 
    3516                     else: 
    3517                         row = top 
    3518                     self.SetGridCursor(row, self._lastCol) 
    3519