Use a raw string in :dir handling code for Python source blocks

This commit is contained in:
Nathaniel Nicandro 2021-11-24 21:28:47 -06:00
parent 724d03ea20
commit a2cbebdfda
2 changed files with 7 additions and 2 deletions

View file

@ -99,7 +99,7 @@ import os
__JUPY_saved_dir = os.getcwd()
os.chdir(\"%s\")
try:
get_ipython().run_cell(\"\"\"%s\"\"\")
get_ipython().run_cell(r\"\"\"%s\"\"\")
finally:
os.chdir(__JUPY_saved_dir)"
(plist-get changelist :dir) code)))

View file

@ -2857,7 +2857,12 @@ os.path.abspath(os.getcwd())"
(concat ": "
(funcall convert-path
(expand-file-name
(directory-file-name default-directory))) "\n"))))))
(directory-file-name default-directory))) "\n")))
(ert-info ("Transformed code and backslashes")
;; See #302
(jupyter-org-test-src-block
"print(r\"\\r\")"
": \\r\n")))))
(ert-deftest jupyter-org--find-mime-types ()
:tags '(org mime)