summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDan Davison <davison@stats.ox.ac.uk>2010-08-03 00:14:35 -0400
committerDan Davison <davison@stats.ox.ac.uk>2010-08-03 00:14:35 -0400
commit12390991200c4d657974648b172a7985e8fc48cc (patch)
tree2f455767f21355e9884673704eb9c746ecd6819c
parent876b115259beb6fb70c82d3f590aa4f3d05bb968 (diff)
downloadorg-mode-12390991200c4d657974648b172a7985e8fc48cc.tar.gz
babel: python: Fix recognition of lists and tuples
2010-08-03 Dan Davison <davison@stats.ox.ac.uk> * ob-python.el (org-babel-python-table-or-string): Fix recognition of lists and tuples Prior to this we had #+begin_src python return [1, 2] #+end_src #+results: : [1, 2]
-rw-r--r--lisp/ob-python.el5
1 files changed, 1 insertions, 4 deletions
diff --git a/lisp/ob-python.el b/lisp/ob-python.el
index ab6da3f..e7101f0 100644
--- a/lisp/ob-python.el
+++ b/lisp/ob-python.el
@@ -125,10 +125,7 @@ Emacs-lisp table, otherwise return the results as a string."
(mapcar (lambda (el) (if (equal el 'None) 'hline el)) res)
res))
(org-babel-read
- (if (or (and (equal (substring results 0 1) "[")
- (equal (substring results -2 -1) "]"))
- (and (equal (substring results 0 1) "(")
- (equal (substring results -2 -1) ")")))
+ (if (and (stringp results) (string-match "^[([].+[])]$" results))
(org-babel-read
(concat "'"
(replace-regexp-in-string