Skip to content

Commit 52787a3

Browse files
committed
Type-assert Int64's from JSON
JSON.jl parses JSON numbers as Int64 by default and but 32bit systems `Int == Int32` and so the type assertion would fail.
1 parent 958973a commit 52787a3

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/handlers.jl

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -124,7 +124,7 @@ request](https://jupyter-client.readthedocs.io/en/latest/messaging.html#completi
124124
"""
125125
function complete_request(socket, kernel, msg)
126126
code = msg.content["code"]::String
127-
cursor_chr = msg.content["cursor_pos"]::Int
127+
cursor_chr = msg.content["cursor_pos"]::Int64
128128
cursorpos = chr2ind(msg, code, cursor_chr)
129129
# Ensure that `cursorpos` is within bounds, Jupyter may send a position out
130130
# of bounds when autocompletion is enabled.
@@ -375,7 +375,7 @@ request](https://jupyter-client.readthedocs.io/en/latest/messaging.html#introspe
375375
function inspect_request(socket, kernel, msg)
376376
try
377377
code = msg.content["code"]::String
378-
cursor_pos = msg.content["cursor_pos"]::Int
378+
cursor_pos = msg.content["cursor_pos"]::Int64
379379
s = get_token(code, chr2ind(msg, code, cursor_pos))
380380
if isempty(s)
381381
content = Dict("status" => "ok", "found" => false)

0 commit comments

Comments
 (0)