Skip to content

Commit a72f380

Browse files
yuyichaostevengj
authored andcommitted
Only import bytestring if it exists (#12)
1 parent f30b5b1 commit a72f380

File tree

2 files changed

+6
-3
lines changed

2 files changed

+6
-3
lines changed

src/LaTeXStrings.jl

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ latexstring(args...) = latexstring(string(args...))
3030
macro L_str(s, flags...) latexstring(s) end
3131
macro L_mstr(s, flags...) latexstring(s) end
3232

33-
import Base: write, endof, getindex, sizeof, search, rsearch, isvalid, next, length, bytestring, IOBuffer, pointer
33+
import Base: write, endof, getindex, sizeof, search, rsearch, isvalid, next, length, IOBuffer, pointer
3434
@compat import Base.show
3535

3636
write(io::IO, s::LaTeXString) = write(io, s.s)
@@ -42,7 +42,11 @@ function show(io::IO, s::LaTeXString)
4242
Base.print_quoted_literal(io, s.s)
4343
end
4444

45-
bytestring(s::LaTeXString) = bytestring(s.s)
45+
if isdefined(Base, :bytestring)
46+
import Base: bytestring
47+
bytestring(s::LaTeXString) = bytestring(s.s)
48+
end
49+
4650
endof(s::LaTeXString) = endof(s.s)
4751
next(s::LaTeXString, i::Int) = next(s.s, i)
4852
length(s::LaTeXString) = length(s.s)

test/REQUIRE

Lines changed: 0 additions & 1 deletion
This file was deleted.

0 commit comments

Comments
 (0)