Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
E
edx-platform
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
edx-platform
Commits
5f723e8d
Commit
5f723e8d
authored
Nov 30, 2014
by
Sarina Canelake
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
s/pylint: disable=W0703/pylint: disable=broad-except/
parent
f223ac84
Hide whitespace changes
Inline
Side-by-side
Showing
10 changed files
with
18 additions
and
18 deletions
+18
-18
cms/djangoapps/contentstore/views/import_export.py
+2
-2
cms/djangoapps/contentstore/views/item.py
+1
-1
cms/djangoapps/contentstore/views/preview.py
+1
-1
common/lib/capa/capa/responsetypes.py
+4
-4
common/lib/xmodule/xmodule/modulestore/xml_importer.py
+2
-2
lms/djangoapps/courseware/management/commands/clean_history.py
+1
-1
lms/djangoapps/instructor/views/api.py
+2
-2
lms/djangoapps/shoppingcart/models.py
+1
-1
lms/djangoapps/verify_student/models.py
+1
-1
pavelib/assets.py
+3
-3
No files found.
cms/djangoapps/contentstore/views/import_export.py
View file @
5f723e8d
...
...
@@ -152,7 +152,7 @@ def import_handler(request, course_key_string):
}]
})
# Send errors to client with stage at which error occurred.
except
Exception
as
exception
:
# pylint: disable=
W0703
except
Exception
as
exception
:
# pylint: disable=
broad-except
_save_request_status
(
request
,
key
,
-
1
)
if
course_dir
.
isdir
():
shutil
.
rmtree
(
course_dir
)
...
...
@@ -251,7 +251,7 @@ def import_handler(request, course_key_string):
_save_request_status
(
request
,
key
,
4
)
# Send errors to client with stage at which error occurred.
except
Exception
as
exception
:
# pylint: disable=
W0703
except
Exception
as
exception
:
# pylint: disable=
broad-except
log
.
exception
(
"error importing course"
)
...
...
cms/djangoapps/contentstore/views/item.py
View file @
5f723e8d
...
...
@@ -221,7 +221,7 @@ def xblock_view_handler(request, usage_key_string, view_name):
# catch exceptions indiscriminately, since after this point they escape the
# dungeon and surface as uneditable, unsaveable, and undeletable
# component-goblins.
except
Exception
as
exc
:
# pylint: disable=
w0703
except
Exception
as
exc
:
# pylint: disable=
broad-except
log
.
debug
(
"unable to render studio_view for
%
r"
,
xblock
,
exc_info
=
True
)
fragment
=
Fragment
(
render_to_string
(
'html_error.html'
,
{
'message'
:
str
(
exc
)}))
...
...
cms/djangoapps/contentstore/views/preview.py
View file @
5f723e8d
...
...
@@ -227,7 +227,7 @@ def get_preview_fragment(request, descriptor, context):
try
:
fragment
=
module
.
render
(
preview_view
,
context
)
except
Exception
as
exc
:
# pylint: disable=
W0703
except
Exception
as
exc
:
# pylint: disable=
broad-except
log
.
warning
(
"Unable to render
%
s for
%
r"
,
preview_view
,
module
,
exc_info
=
True
)
fragment
=
Fragment
(
render_to_string
(
'html_error.html'
,
{
'message'
:
str
(
exc
)}))
return
fragment
...
...
common/lib/capa/capa/responsetypes.py
View file @
5f723e8d
...
...
@@ -2229,7 +2229,7 @@ class ExternalResponse(LoncapaResponse):
cmap
=
CorrectMap
()
try
:
submission
=
[
student_answers
[
k
]
for
k
in
idset
]
except
Exception
as
err
:
# pylint: disable=
W0703
except
Exception
as
err
:
# pylint: disable=
broad-except
log
.
error
(
'Error
%
s: cannot get student answer for
%
s; student_answers=
%
s'
,
err
,
...
...
@@ -2244,7 +2244,7 @@ class ExternalResponse(LoncapaResponse):
try
:
rxml
=
self
.
do_external_request
(
'get_score'
,
extra_payload
)
except
Exception
as
err
:
# pylint: disable=
W0703
except
Exception
as
err
:
# pylint: disable=
broad-except
log
.
error
(
'Error
%
s'
,
err
)
if
self
.
capa_system
.
DEBUG
:
cmap
.
set_dict
(
dict
(
zip
(
sorted
(
...
...
@@ -2276,7 +2276,7 @@ class ExternalResponse(LoncapaResponse):
try
:
rxml
=
self
.
do_external_request
(
'get_answers'
,
{})
exans
=
json
.
loads
(
rxml
.
find
(
'expected'
)
.
text
)
except
Exception
as
err
:
# pylint: disable=
W0703
except
Exception
as
err
:
# pylint: disable=
broad-except
log
.
error
(
'Error
%
s'
,
err
)
if
self
.
capa_system
.
DEBUG
:
msg
=
'<span class="inline-error">
%
s</span>'
%
str
(
...
...
@@ -2486,7 +2486,7 @@ class FormulaResponse(LoncapaResponse):
name
=
hxml
.
get
(
'name'
)
correct_answer
=
contextualize_text
(
hxml
.
get
(
'answer'
),
self
.
context
)
# pylint: disable=
W0703
# pylint: disable=
broad-except
try
:
correctness
=
self
.
check_formula
(
correct_answer
,
...
...
common/lib/xmodule/xmodule/modulestore/xml_importer.py
View file @
5f723e8d
...
...
@@ -605,7 +605,7 @@ def _import_course_draft(
drafts
.
append
(
draft
)
except
Exception
:
# pylint: disable=
W0703
except
Exception
:
# pylint: disable=
broad-except
logging
.
exception
(
'Error while parsing course xml.'
)
# sort drafts by `index_in_children_list` attribute
...
...
@@ -614,7 +614,7 @@ def _import_course_draft(
for
draft
in
get_draft_subtree_roots
(
drafts
):
try
:
_import_module
(
draft
.
module
)
except
Exception
:
# pylint: disable=
W0703
except
Exception
:
# pylint: disable=
broad-except
logging
.
exception
(
'while importing draft descriptor
%
s'
,
draft
.
module
)
...
...
lms/djangoapps/courseware/management/commands/clean_history.py
View file @
5f723e8d
...
...
@@ -81,7 +81,7 @@ class StudentModuleHistoryCleaner(object):
for
smid
in
self
.
module_ids_to_check
(
batch_size
):
try
:
self
.
clean_one_student_module
(
smid
)
except
Exception
:
# pylint: disable=
W0703
except
Exception
:
# pylint: disable=
broad-except
trace
=
traceback
.
format_exc
()
self
.
say
(
"Couldn't clean student_module_id {}:
\n
{}"
.
format
(
smid
,
trace
))
if
not
self
.
dry_run
:
...
...
lms/djangoapps/instructor/views/api.py
View file @
5f723e8d
...
...
@@ -261,7 +261,7 @@ def register_and_enroll_students(request, course_id): # pylint: disable=too-man
try
:
upload_file
=
request
.
FILES
.
get
(
'students_list'
)
students
=
[
row
for
row
in
csv
.
reader
(
upload_file
.
read
()
.
splitlines
())]
except
Exception
:
# pylint: disable=
W0703
except
Exception
:
# pylint: disable=
broad-except
general_errors
.
append
({
'username'
:
''
,
'email'
:
''
,
'response'
:
_
(
'Could not read uploaded file.'
)
})
...
...
@@ -488,7 +488,7 @@ def students_update_enrollment(request, course_id):
'invalidIdentifier'
:
True
,
})
except
Exception
as
exc
:
# pylint: disable=
W0703
except
Exception
as
exc
:
# pylint: disable=
broad-except
# catch and log any exceptions
# so that one error doesn't cause a 500.
log
.
exception
(
"Error while #{}ing student"
)
...
...
lms/djangoapps/shoppingcart/models.py
View file @
5f723e8d
...
...
@@ -421,7 +421,7 @@ class Order(models.Model):
}
})
except
Exception
:
# pylint: disable=
W0703
except
Exception
:
# pylint: disable=
broad-except
# Capturing all exceptions thrown while tracking analytics events. We do not want
# an operation to fail because of an analytics event, so we will capture these
# errors in the logs.
...
...
lms/djangoapps/verify_student/models.py
View file @
5f723e8d
...
...
@@ -552,7 +552,7 @@ class SoftwareSecurePhotoVerification(PhotoVerification):
attempt
=
attempts
[
0
]
if
attempt
.
status
!=
"approved"
:
return
False
except
Exception
:
# pylint: disable=
W0703
except
Exception
:
# pylint: disable=
broad-except
return
False
return
True
...
...
pavelib/assets.py
View file @
5f723e8d
...
...
@@ -60,7 +60,7 @@ class CoffeeScriptWatcher(PatternMatchingEventHandler):
print
(
'
\t
CHANGED:'
,
event
.
src_path
)
try
:
compile_coffeescript
(
event
.
src_path
)
except
Exception
:
# pylint: disable=
W0703
except
Exception
:
# pylint: disable=
broad-except
traceback
.
print_exc
()
...
...
@@ -89,7 +89,7 @@ class SassWatcher(PatternMatchingEventHandler):
print
(
'
\t
CHANGED:'
,
event
.
src_path
)
try
:
compile_sass
()
except
Exception
:
# pylint: disable=
W0703
except
Exception
:
# pylint: disable=
broad-except
traceback
.
print_exc
()
...
...
@@ -110,7 +110,7 @@ class XModuleSassWatcher(SassWatcher):
print
(
'
\t
CHANGED:'
,
event
.
src_path
)
try
:
process_xmodule_assets
()
except
Exception
:
# pylint: disable=
W0703
except
Exception
:
# pylint: disable=
broad-except
traceback
.
print_exc
()
...
...
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