Skip to content

Commit 32d7857

Browse files
authored
Merge pull request #787 from bpython/deprecation-warnings
Show deprecation warnings for urwid/curses/python2.
2 parents 716a92e + 244228c commit 32d7857

File tree

10 files changed

+601
-426
lines changed

10 files changed

+601
-426
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: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1988,6 +1988,24 @@ 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(
1994+
_(
1995+
"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."
1996+
)
1997+
)
1998+
clirepl.write("\n")
1999+
2000+
if sys.version_info[0] == 2:
2001+
# XXX these deprecation warnings need to go at some point
2002+
clirepl.write(
2003+
_(
2004+
"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."
2005+
)
2006+
)
2007+
clirepl.write("\n")
2008+
19912009
exit_value = clirepl.repl()
19922010
if hasattr(sys, "exitfunc"):
19932011
sys.exitfunc()

bpython/curtsies.py

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -201,6 +201,15 @@ 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(
208+
_(
209+
"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."
210+
)
211+
)
212+
204213
global repl
205214
repl = FullCurtsiesRepl(config, locals_, welcome_message, interp)
206215
try:

0 commit comments

Comments
 (0)