Skip to content

Commit

Permalink
avoid deprecation warning in Julia 0.3
Browse files Browse the repository at this point in the history
  • Loading branch information
stevengj committed Feb 26, 2014
1 parent a4e4c60 commit 480cf86
Showing 1 changed file with 9 additions and 6 deletions.
15 changes: 9 additions & 6 deletions src/PyCall.jl
Original file line number Diff line number Diff line change
Expand Up @@ -652,12 +652,15 @@ length(m::PyObjectMembers) = length(m.members)
# and providing access to o's members (converted to PyAny) as w.member.

# we skip wrapping Julia reserved words (which cannot be type members)
const reserved = Set("while", "if", "for", "try", "return", "break",
"continue", "function", "macro", "quote", "let", "local",
"global", "const", "abstract", "typealias", "type",
"bitstype", "immutable", "ccall", "do", "module",
"baremodule", "using", "import", "export", "importall",
"pymember", "false", "true")
const reserved = Set{ASCIIString}()
for w in ("while", "if", "for", "try", "return", "break",
"continue", "function", "macro", "quote", "let", "local",
"global", "const", "abstract", "typealias", "type",
"bitstype", "immutable", "ccall", "do", "module",
"baremodule", "using", "import", "export", "importall",
"pymember", "false", "true")
push!(reserved, w) # construct Set this way for compat with Julia 0.2/0.3
end

function pywrap(o::PyObject, mname::Symbol=:__anon__)
@pyinitialize
Expand Down

0 comments on commit 480cf86

Please sign in to comment.