Skip to content

Commit 8c0671a

Browse files
KristofferCKeno
authored andcommitted
fix Base.process_events for changes in Julia master (#2)
* fix Base.process_events for changes in Julia master * Update .travis.yml * Update REQUIRE * Update REQUIRE * Update .travis.yml
1 parent f61213b commit 8c0671a

File tree

3 files changed

+5
-4
lines changed

3 files changed

+5
-4
lines changed

.travis.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ language: julia
22
os:
33
- linux
44
julia:
5-
- 0.7
5+
- 1.1
66
- nightly
77
notifications:
88
email: false

REQUIRE

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
1-
julia 0.7-beta2
1+
julia 1.1
22
VT100

src/TerminalRegressionTests.jl

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -133,19 +133,20 @@ module TerminalRegressionTests
133133
_compare(Vector{UInt8}(codeunits(decorator)), decoratorbuf)
134134
end
135135

136+
process_events_compat() = @static VERSION >= v"1.2.0-DEV.566" ? Base.process_events() : Base.process_events(false)
136137
function process_all_buffered(emuterm)
137138
# Since writes to the tty are asynchronous, there's an
138139
# inherent race condition between them being sent to the
139140
# kernel and being available to epoll. We write a sentintel value
140141
# here and wait for it to be read back.
141142
sentinel = Ref{UInt32}(0xffffffff)
142143
ccall(:write, Cvoid, (Cint, Ptr{UInt32}, Csize_t), emuterm.pty.slave, sentinel, sizeof(UInt32))
143-
Base.process_events(false)
144+
process_events_compat()
144145
# Read until we get our sentinel
145146
while bytesavailable(emuterm.pty.master) < sizeof(UInt32) ||
146147
reinterpret(UInt32, emuterm.pty.master.buffer.data[(emuterm.pty.master.buffer.size-3):emuterm.pty.master.buffer.size])[] != sentinel[]
147148
emuterm.aggressive_yield || yield()
148-
Base.process_events(false)
149+
process_events_compat()
149150
sleep(0.01)
150151
end
151152
data = IOBuffer(readavailable(emuterm.pty.master)[1:(end-4)])

0 commit comments

Comments
 (0)