Skip to content

Commit 3d0643e

Browse files
authored
Flake8v4 (#140)
* capitalize Trustees * Exception on errorwrapper * wx.PyObjectError in except * ValueError and Exception * Exception * remove import
1 parent c9ecd94 commit 3d0643e

File tree

6 files changed

+11
-12
lines changed

6 files changed

+11
-12
lines changed

src/diffpy/pdfgui/gui/aboutdialog.py

+2-2
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,8 @@
33
#
44
# PDFgui by DANSE Diffraction group
55
# Simon J. L. Billinge
6-
# (c) 2006 trustees of the Michigan State University.
7-
# (c) 2024 trustees of the Columbia University in the City
6+
# (c) 2006 Trustees of the Michigan State University.
7+
# (c) 2024 Trustees of the Columbia University in the City
88
# of New York
99
# All rights reserved.
1010
#

src/diffpy/pdfgui/gui/errorwrapper.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -75,7 +75,7 @@ def _f(*args, **kwargs):
7575
return rvpass
7676

7777
# Everything else
78-
except:
78+
except Exception:
7979
if pdfguiglobals.dbopts.pythondebugger:
8080
import pdb
8181

src/diffpy/pdfgui/gui/fittree.py

+5-5
Original file line numberDiff line numberDiff line change
@@ -356,7 +356,7 @@ def AddFit(self, fitname="Fit 1", cdata=None, paste=False):
356356
cdata = self.control.paste(cdata, None, fitname, pos)
357357
self.SetControlData(newfit, cdata)
358358
return newfit
359-
except:
359+
except Exception:
360360
self.Delete(newfit)
361361
raise
362362
return
@@ -427,7 +427,7 @@ def AddPhase(self, node, label, insertafter=None, filename=None, makedata=True,
427427
elif cdata is not None:
428428
self.control.paste(cdata, pdata, label, pos)
429429
return newphase
430-
except:
430+
except Exception:
431431
self.Delete(newphase)
432432
raise
433433
return
@@ -492,7 +492,7 @@ def AddDataSet(self, node, label, insertafter=None, filename=None, makedata=True
492492
elif cdata is not None:
493493
self.control.paste(cdata, pdata, label, pos)
494494
return newset
495-
except:
495+
except Exception:
496496
self.Delete(newset)
497497
raise
498498
return
@@ -553,7 +553,7 @@ def AddCalc(self, node, label, insertafter=None, makedata=True, cdata=None):
553553
elif cdata is not None:
554554
self.control.paste(cdata, pdata, label, pos)
555555
return newcalc
556-
except:
556+
except Exception:
557557
self.Delete(newcalc)
558558
raise
559559
return
@@ -611,7 +611,7 @@ def GetClipboard(self):
611611
if cdatabytes[:16] == "pdfgui_cliboard=".encode():
612612
cdatabytes = cdatabytes[16:]
613613
cdata = pickle_loads(cdatabytes)
614-
except:
614+
except Exception:
615615
pass
616616
return cdata
617617

src/diffpy/pdfgui/gui/phaseconfigurepanel.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -393,7 +393,7 @@ def applyTextCtrlChange(self, id, value):
393393

394394
return value
395395

396-
except:
396+
except Exception:
397397
return None
398398

399399
def applyCellChange(self, i, j, value):

src/diffpy/pdfgui/gui/phasepanelutils.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -234,7 +234,7 @@ def canPasteIntoCells(panel):
234234
# Strip any trailing tabs
235235
rowlist = [r.rstrip("\t") for r in rowlist]
236236
celllist = [r.split("\t") for r in rowlist]
237-
except:
237+
except wx.PyDeadObjectError:
238238
return False
239239

240240
if len(celllist) == 0:

src/diffpy/pdfgui/gui/plotpanel.py

+1-2
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,6 @@
1616

1717
# generated by wxGlade 0.9.3 on Fri Jul 19 16:05:24 2019
1818

19-
import sys
2019

2120
import wx
2221

@@ -167,7 +166,7 @@ def _represent(mixedNames):
167166
xvals = _represent(xdata)
168167
try:
169168
xvals.remove("rw")
170-
except:
169+
except ValueError:
171170
pass
172171
numericStringSort(xvals)
173172

0 commit comments

Comments
 (0)