[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:
parent
7b88ffb34f
commit
b97e909ef4
@ -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
|
||||||
|
@ -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]
|
||||||
|
@ -9,7 +9,6 @@
|
|||||||
#
|
#
|
||||||
#
|
#
|
||||||
#
|
#
|
||||||
fail CantShiftToMultiIrbMode unless defined?(Thread)
|
|
||||||
|
|
||||||
module IRB
|
module IRB
|
||||||
class JobManager
|
class JobManager
|
||||||
|
Loading…
x
Reference in New Issue
Block a user