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 /yaksh | |
parent | bce87033267afdbb4aff958c26d1e6d0cac6d220 (diff) | |
download | online_test-589c5ecbd4fcafffa2e237012c4c2124b53dca0a.tar.gz online_test-589c5ecbd4fcafffa2e237012c4c2124b53dca0a.tar.bz2 online_test-589c5ecbd4fcafffa2e237012c4c2124b53dca0a.zip |
Removed nested try..except
Diffstat (limited to 'yaksh')
-rw-r--r-- | yaksh/file_utils.py | 9 |
1 files changed, 4 insertions, 5 deletions
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) |