提交 8ad24e96 authored 作者: Frederic Bastien's avatar Frederic Bastien

Fix newer flake8 error

上级 f914681f
......@@ -130,7 +130,7 @@ def maybe_add_to_os_environ_pathlist(var, newpath):
if newpath not in oldpaths:
newpaths = os.pathsep.join([newpath] + oldpaths)
os.environ[var] = newpaths
except:
except Exception:
pass
__all__ += ['maybe_add_to_os_environ_pathlist']
......@@ -124,7 +124,7 @@ class change_flags(object):
try:
for k, v in iteritems(self.confs):
v.__set__(None, self.new_vals[k])
except:
except Exception:
self.__exit__()
raise
......
......@@ -245,7 +245,7 @@ class Loop(VM):
t1 = time.time()
self.call_counts[i] += 1
self.call_times[i] += t1 - t0
except:
except Exception:
link.raise_with_op(node, thunk)
else:
for cont in self.pre_call_clear:
......@@ -253,7 +253,7 @@ class Loop(VM):
try:
for thunk, node in zip(self.thunks, self.nodes):
thunk()
except:
except Exception:
link.raise_with_op(node, thunk)
......@@ -289,7 +289,7 @@ class LoopGC(VM):
for old_s in old_storage:
old_s[0] = None
i += 1
except:
except Exception:
link.raise_with_op(node, thunk)
else:
for cont in self.pre_call_clear:
......@@ -300,7 +300,7 @@ class LoopGC(VM):
thunk()
for old_s in old_storage:
old_s[0] = None
except:
except Exception:
link.raise_with_op(node, thunk)
......
......@@ -1007,7 +1007,7 @@ class ScanInplaceOptimizer(Optimizer):
try:
alloc_ops += (theano.gpuarray.GpuAlloc,
theano.gpuarray.GpuAllocEmpty)
except:
except Exception:
pass
nodes = fgraph.toposort()[::-1]
......
......@@ -3838,7 +3838,7 @@ class Split(Op):
try:
len_along_axis = x.shape[axis]
except:
except Exception:
raise ValueError('Split.perform() with axis=(%s) is invalid'
' for x.shape==(%s)'
% (axis, x.shape))
......
......@@ -104,7 +104,7 @@ class PdbBreakpoint(Op):
if condition:
try:
monitored = [np.asarray(inp) for inp in inputs[1:]]
except:
except Exception:
raise ValueError("Some of the inputs to the PdbBreakpoint op "
"'%s' could not be casted to NumPy arrays" %
self.name)
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论