diff options
author | prathamesh | 2017-11-07 13:47:50 +0530 |
---|---|---|
committer | prathamesh | 2017-11-07 13:47:50 +0530 |
commit | 589c5ecbd4fcafffa2e237012c4c2124b53dca0a (patch) | |
tree | d9c116217ce82dbdcc7182fe1afee37ab6a9b6f6 | |
parent | bce87033267afdbb4aff958c26d1e6d0cac6d220 (diff) | |
download | online_test-589c5ecbd4fcafffa2e237012c4c2124b53dca0a.tar.gz online_test-589c5ecbd4fcafffa2e237012c4c2124b53dca0a.tar.bz2 online_test-589c5ecbd4fcafffa2e237012c4c2124b53dca0a.zip |
Removed nested try..except
-rw-r--r-- | CHANGELOG.txt | 1 | ||||
-rw-r--r-- | yaksh/file_utils.py | 9 |
2 files changed, 5 insertions, 5 deletions
diff --git a/CHANGELOG.txt b/CHANGELOG.txt index ab9e4b2..a687446 100644 --- a/CHANGELOG.txt +++ b/CHANGELOG.txt @@ -11,6 +11,7 @@ * Updated the validation of MCQ/MCC type question. * Fixed a bug that did not allow expected input in Standard I/O type question to be none. * UI changes in grade user, view answerpaper and monitor pages. +* Added the facility to create users by uploading CSV. * Fixed a bug that would require shebang to be put in for Bash assertion based questions. === 0.6.0 (11-05-2017) === diff --git a/yaksh/file_utils.py b/yaksh/file_utils.py index 0d80b8f..4b8640e 100644 --- a/yaksh/file_utils.py +++ b/yaksh/file_utils.py @@ -53,11 +53,10 @@ def extract_files(zip_file, path=None): def is_csv(document): try: - try: - content = document.read(1024).decode('utf-8') - except AttributeError: - document.seek(0) - content = document.read(1024) + content = document.read(1024).decode('utf-8') + except AttributeError: + document.seek(0) + content = document.read(1024) sniffer = csv.Sniffer() dialect = sniffer.sniff(content) document.seek(0) |