1
0
Fork 0
mirror of https://github.com/ruby/ruby.git synced 2022-11-09 12:17:21 -05:00

[ruby/irb] Remove unnecessary Thread presence check

They were introduced around 20 years ago, when Thread is not yet
stabilized. So we don't need them anymore.

https://github.com/ruby/irb/commit/4c75e03b2b
This commit is contained in:
st0012 2022-10-02 10:20:26 +01:00 committed by git
parent 7b88ffb34f
commit b97e909ef4
3 changed files with 2 additions and 7 deletions

View file

@ -389,11 +389,7 @@ module IRB
#
# Will raise an Abort exception, or the given +exception+.
def IRB.irb_abort(irb, exception = Abort)
if defined? Thread
irb.context.thread.raise exception, "abort then interrupt!"
else
raise exception, "abort then interrupt!"
end
irb.context.thread.raise exception, "abort then interrupt!"
end
class Irb

View file

@ -32,7 +32,7 @@ module IRB
else
@workspace = WorkSpace.new
end
@thread = Thread.current if defined? Thread
@thread = Thread.current
# copy of default configuration
@ap_name = IRB.conf[:AP_NAME]

View file

@ -9,7 +9,6 @@
#
#
#
fail CantShiftToMultiIrbMode unless defined?(Thread)
module IRB
class JobManager