Skip to content

Commit 08c490f

Browse files
committed
Show deprecation warnings for urwid/curses/python2.
1 parent e710adc commit 08c490f

File tree

4 files changed

+32
-0
lines changed

4 files changed

+32
-0
lines changed

CHANGELOG

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,13 @@ Changelog
44
0.19
55
----
66

7+
General information:
8+
* The bpython-cli and bpython-urwid rendering backends have been deprecated and
9+
will show a warning that they'll be removed in a future release when started.
10+
* Usage in combination with Python 2 has been deprecated. This does not mean that
11+
support is dropped instantly but rather that at some point in the future we will
12+
stop running our testcases against Python 2.
13+
714
New features:
815

916
Fixes:

bpython/cli.py

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1988,6 +1988,16 @@ def main_curses(scr, args, config, interactive=True, locals_=None, banner=None):
19881988
if banner is not None:
19891989
clirepl.write(banner)
19901990
clirepl.write("\n")
1991+
1992+
# XXX these deprecation warnings need to go at some point
1993+
clirepl.write("WARNING: You are using `bpython-cli`, the curses backend for `bpython`. This backend has been deprecated in version 0.19 and might disappear in a future version.")
1994+
clirepl.write("\n")
1995+
1996+
if sys.version_info[0] == 2:
1997+
# XXX these deprecation warnings need to go at some point
1998+
clirepl.write("WARNING: You are using `bpython` on Python 2. Support for Python 2 has been deprecated in version 0.19 and might disappear in a future version.")
1999+
clirepl.write("\n")
2000+
19912001
exit_value = clirepl.repl()
19922002
if hasattr(sys, "exitfunc"):
19932003
sys.exitfunc()

bpython/curtsies.py

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -201,6 +201,11 @@ def main(args=None, locals_=None, banner=None, welcome_message=None):
201201
print(bpargs.version_banner())
202202
if banner is not None:
203203
print(banner)
204+
205+
if sys.version_info[0] == 2:
206+
# XXX these deprecation warnings need to go at some point
207+
print("WARNING: You are using `bpython` on Python 2. Support for Python 2 has been deprecated in version 0.19 and might disappear in a future version.")
208+
204209
global repl
205210
repl = FullCurtsiesRepl(config, locals_, welcome_message, interp)
206211
try:

bpython/urwid.py

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1390,6 +1390,16 @@ def start(main_loop, user_data):
13901390
if banner is not None:
13911391
myrepl.write(banner)
13921392
myrepl.write("\n")
1393+
1394+
# XXX these deprecation warnings need to go at some point
1395+
myrepl.write("WARNING: You are using `bpython-urwid`, the urwid backend for `bpython`. This backend has been deprecated in version 0.19 and might disappear in a future version.")
1396+
myrepl.write("\n")
1397+
1398+
if sys.version_info[0] == 2:
1399+
# XXX these deprecation warnings need to go at some point
1400+
myrepl.write("WARNING: You are using `bpython` on Python 2. Support for Python 2 has been deprecated in version 0.19 and might disappear in a future version.")
1401+
myrepl.write("\n")
1402+
13931403
myrepl.start()
13941404

13951405
# This bypasses main_loop.set_alarm_in because we must *not*

0 commit comments

Comments
 (0)