Skip to content

Commit

Permalink
Merge pull request #182 from ccnmtl/pyup-update-flake8-3.4.1-to-3.5.0
Browse files Browse the repository at this point in the history
Update flake8 to 3.5.0
  • Loading branch information
nikolas committed Nov 1, 2017
2 parents 5d43474 + 0c319ed commit 0b58def
Show file tree
Hide file tree
Showing 6 changed files with 23 additions and 11 deletions.
5 changes: 5 additions & 0 deletions CHANGES.txt
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
1.3.3
==================

* Removed bare except statements

1.3.2 (2017-05-25)
==================

Expand Down
2 changes: 1 addition & 1 deletion pagetree/helpers.py
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,6 @@ def block_submitted(block, user):
s = block.unlocked(user)
if not s:
return False
except:
except AttributeError:
pass
return True
22 changes: 14 additions & 8 deletions pagetree/migrations/0002_delete_testblock.py
Original file line number Diff line number Diff line change
@@ -1,20 +1,26 @@
# -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import migrations
import sys
from django.db import (
migrations,
DatabaseError, OperationalError, ProgrammingError
)


class ConditionalDeleteModel(migrations.DeleteModel):
def database_forwards(self, app_label, schema_editor, from_state,
to_state):
def database_forwards(
self, app_label, schema_editor, from_state, to_state):
# The tests use this model
if 'runtests.py' in sys.argv:
return

try:
super(ConditionalDeleteModel, self).database_forwards(
self, app_label, schema_editor, from_state, to_state)
except:
app_label, schema_editor, from_state, to_state)
except (DatabaseError, OperationalError, ProgrammingError):
""" if it fails, it's totally fine. it just means that the
table we wanted to delete doesn't exist. so we ignore it.
it would be nice to catch a more specific exception, but
different databases raise different ones..."""
"""
pass


Expand Down
2 changes: 1 addition & 1 deletion pagetree/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -510,7 +510,7 @@ def submitted(self, user):
if not s:
# there's an unsubmitted block
return False
except:
except (AttributeError, ValueError):
# most likely: no unlocked() method
pass
# made it all the way through without any blocks
Expand Down
1 change: 1 addition & 0 deletions runtests.py
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,7 @@ def main():
django.setup()

# Fire off the tests
call_command('migrate')
call_command('test')
call_command('jenkins', '--enable-coverage')

Expand Down
2 changes: 1 addition & 1 deletion test_reqs.txt
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
django-treebeard==4.1.2
Markdown==2.6.9
coverage==4.4.1
flake8==3.4.1
flake8==3.5.0
django-jenkins==0.110.0
pep8==1.7.1
pyflakes==1.6.0
Expand Down

0 comments on commit 0b58def

Please sign in to comment.