Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
D
django-rest-framework
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
edx
django-rest-framework
Commits
46e4ba25
Commit
46e4ba25
authored
Jan 04, 2012
by
Craig Blaszczyk
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
#75 remove except statements which are overly broad in the exception they catch
parent
be11336d
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
6 additions
and
6 deletions
+6
-6
djangorestframework/renderers.py
+2
-2
djangorestframework/utils/__init__.py
+1
-1
djangorestframework/utils/breadcrumbs.py
+1
-1
djangorestframework/utils/mediatypes.py
+1
-1
examples/pygments_api/tests.py
+1
-1
No files found.
djangorestframework/renderers.py
View file @
46e4ba25
...
...
@@ -246,14 +246,14 @@ class DocumentingTemplateRenderer(BaseRenderer):
form_instance
=
view
.
get_bound_form
(
view
.
response
.
cleaned_content
,
method
=
method
)
if
form_instance
and
not
form_instance
.
is_valid
():
form_instance
=
None
except
:
except
Exception
:
form_instance
=
None
# If we still don't have a form instance then try to get an unbound form
if
not
form_instance
:
try
:
form_instance
=
view
.
get_bound_form
(
method
=
method
)
except
:
except
Exception
:
pass
# If we still don't have a form instance then try to get an unbound form which can tunnel arbitrary content types
...
...
djangorestframework/utils/__init__.py
View file @
46e4ba25
...
...
@@ -43,7 +43,7 @@ def url_resolves(url):
"""
try
:
resolve
(
url
)
except
:
except
Exception
:
return
False
return
True
...
...
djangorestframework/utils/breadcrumbs.py
View file @
46e4ba25
...
...
@@ -11,7 +11,7 @@ def get_breadcrumbs(url):
try
:
(
view
,
unused_args
,
unused_kwargs
)
=
resolve
(
url
)
except
:
except
Exception
:
pass
else
:
# Check if this is a REST framework view, and if so add it to the breadcrumbs
...
...
djangorestframework/utils/mediatypes.py
View file @
46e4ba25
...
...
@@ -109,7 +109,7 @@ class _MediaType(object):
# """
# try:
# return Decimal(self.params.get('q', '1.0'))
# except:
# except
Exception
:
# return Decimal(0)
#def score(self):
...
...
examples/pygments_api/tests.py
View file @
46e4ba25
...
...
@@ -18,7 +18,7 @@ class TestPygmentsExample(TestCase):
def
tearDown
(
self
):
try
:
shutil
.
rmtree
(
self
.
temp_dir
)
except
:
except
Exception
:
pass
def
test_get_to_root
(
self
):
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment