summaryrefslogtreecommitdiff
path: root/yaksh/file_utils.py
diff options
context:
space:
mode:
Diffstat (limited to 'yaksh/file_utils.py')
-rw-r--r--yaksh/file_utils.py9
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)