Skip to content

Commit 968b140

Browse files
committed
TST: Update setup and remove exception
Remove bare exceptions Update setup Move flake8 run
1 parent 76f5d4f commit 968b140

4 files changed

Lines changed: 6 additions & 6 deletions

File tree

.travis.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -91,11 +91,11 @@ install:
9191

9292
script:
9393
- set -e
94-
- flake8 arch
9594
- pytest --cov-config .coveragerc --cov=arch arch --durations=10
9695
- python ci/performance.py
9796
- if [[ ${DOCBUILD} = true ]]; then cd doc && make html && cd .. ; fi
9897
- if [[ ${DOCBUILD} = true && ${TRAVIS_BRANCH} = "master" ]]; then doctr deploy doc; fi
98+
- flake8 arch
9999

100100
after_success:
101101
- if [[ ${COVERAGE} = true ]]; then coveralls --rcfile=${SRCDIR}/.coveragerc; fi

arch/bootstrap/base.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -577,7 +577,7 @@ def apply(self, func, reps=1000, extra_kwargs=None):
577577
base = func(*self._args, **kwargs)
578578
try:
579579
num_params = base.shape[0]
580-
except:
580+
except AttributeError:
581581
num_params = 1
582582
results = np.zeros((reps, num_params))
583583
count = 0

arch/tests/univariate/test_volatility.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77

88
try:
99
from arch.univariate import _recursions as rec
10-
except:
10+
except ImportError:
1111
from arch.univariate import recursions_python as rec
1212
from arch.univariate.volatility import GARCH, ARCH, HARCH, ConstantVariance, \
1313
EWMAVariance, RiskMetrics2006, EGARCH, FixedVariance

setup.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -141,7 +141,7 @@ def strip_rc(version):
141141
from pandas.version import short_version as version
142142
except ImportError:
143143
pass
144-
except: # very old version
144+
finally: # very old version
145145
satisfies_req = False
146146
else:
147147
raise NotImplementedError('Unknown package')
@@ -209,7 +209,7 @@ def strip_rc(version):
209209
with open(resource_filename, 'wb') as resource:
210210
resource.write(resources['outputs'][key])
211211

212-
except:
212+
except Exception:
213213
import warnings
214214

215215
warnings.warn('Unable to convert {original} to {target}. This '
@@ -223,7 +223,7 @@ def strip_rc(version):
223223
print(sys.exc_info()[0])
224224
print(sys.exc_info()[1])
225225

226-
except:
226+
except Exception:
227227
import warnings
228228

229229
warnings.warn('Unable to import required modules from the jupyter project.'

0 commit comments

Comments
 (0)