def setupWorkerTransition():
 default_warn_method = getWarningMethod()
 def custom_warn_method(message, category, stacklevel):
  if (stacklevel is not None):
   stacklevel += 1
  if (_WORKER_WARNING_MARK in message):
   message = message.replace(_WORKER_WARNING_MARK, '')
   warnings.warn(DeprecatedWorkerNameWarning(message), message, stacklevel)
  else:
   default_warn_method(message, category, stacklevel)
 setWarningMethod(custom_warn_method)

def setupWorkerTransition ( ) : default_warn_method = getWarningMethod ( ) def custom_warn_method ( message , category , stacklevel ) : if ( stacklevel is not None ) : stacklevel += 1 if ( _WORKER_WARNING_MARK in message ) : message = message . replace ( _WORKER_WARNING_MARK , '' ) warnings . warn ( DeprecatedWorkerNameWarning ( message ) , message , stacklevel ) else : default_warn_method ( message , category , stacklevel ) setWarningMethod ( custom_warn_method )
hook twisted deprecation machinery to use custom warning class for worker api deprecation warnings .