[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+. # Will raise an Abort exception, or the given +exception+.
def IRB.irb_abort(irb, exception = Abort) def IRB.irb_abort(irb, exception = Abort)
if defined? Thread irb.context.thread.raise exception, "abort then interrupt!"
irb.context.thread.raise exception, "abort then interrupt!"
else
raise exception, "abort then interrupt!"
end
end end
class Irb class Irb

View File

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

View File

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