- Commit
- f26d60deacc2d4cbce37fb54602f491e12494557
- Parent
- e982e57fc3b4348bb601a8764ce2d17f0dc053ae
- Author
- John MacFarlane <jgm@berkeley.edu>
- Date
Use os.path.join in test/cmark.py.
For proper cross-platform paths.
My personal build of CMark ✏️
Use os.path.join in test/cmark.py.
For proper cross-platform paths.
1 file changed, 5 insertions, 5 deletions
Status | File Name | N° Changes | Insertions | Deletions |
Modified | test/cmark.py | 10 | 5 | 5 |
diff --git a/test/cmark.py b/test/cmark.py @@ -4,6 +4,7 @@ from ctypes import CDLL, c_char_p, c_long from subprocess import * import platform +import os def pipe_through_prog(prog, text): p1 = Popen(prog.split(), stdout=PIPE, stdin=PIPE, stderr=PIPE) @@ -22,17 +23,16 @@ class CMark: self.to_html = lambda x: pipe_through_prog(prog, x) else: sysname = platform.system() - libname = "libcmark" if sysname == 'Darwin': - libname += ".dylib" + libname = "libcmark.dylib" elif sysname == 'Windows': libname = "cmark.dll" else: - libname += ".so" + libname = "libcmark.so" if library_dir: - libpath = library_dir + "/" + libname + libpath = os.path.join(library_dir, libname) else: - libpath = "build/src/" + libname + libpath = os.path.join("build", "src", libname) cmark = CDLL(libpath) markdown = cmark.cmark_markdown_to_html markdown.restype = c_char_p