[CLN] Add deprecation warning to tell the end of linux support

This commit is contained in:
Benedek Racz 2019-10-01 17:19:05 +02:00
parent 366c89aa59
commit 2cca9aa5f2

View File

@ -75,6 +75,7 @@ Pexpect is intended for UNIX-like operating systems.""")
# #
# Import built in modules # Import built in modules
# #
import warnings
import logging import logging
import os import os
import time import time
@ -110,6 +111,13 @@ except ImportError as e:
screenbufferfillchar = '\4' screenbufferfillchar = '\4'
maxconsoleY = 8000 maxconsoleY = 8000
warnings.simplefilter("always", category=DeprecationWarning)
no_unix_deprecation_warning = '''
################################## WARNING ##################################
{} is deprecated, and will be removed soon.
Please contact me and report it at github.com/raczben/wexpect if you use it.
################################## WARNING ##################################
'''
# The version is handled by the package: pbr, which derives the version from the git tags. # The version is handled by the package: pbr, which derives the version from the git tags.
try: try:
@ -534,7 +542,9 @@ class spawn_unix (object):
s.append('delayafterterminate: ' + str(self.delayafterterminate)) s.append('delayafterterminate: ' + str(self.delayafterterminate))
return '\n'.join(s) return '\n'.join(s)
def _spawn(self,command,args=[]): def _spawn(self,command,args=[]):
warnings.warn(no_unix_deprecation_warning.format("spawn_unix::_spawn"), DeprecationWarning)
"""This starts the given command in a child process. This does all the """This starts the given command in a child process. This does all the
fork/exec type of stuff for a pty. This is called by __init__. If args fork/exec type of stuff for a pty. This is called by __init__. If args