From 6a15f918b5a6fb5113d5332ebf27df1d5360e66c Mon Sep 17 00:00:00 2001 From: Terry Jan Reedy Date: Wed, 13 Jul 2022 21:09:07 -0400 Subject: idlelib: replace 'while 1' with 'while True' (#94827) --- Lib/idlelib/editor.py | 2 +- Lib/idlelib/history.py | 2 +- Lib/idlelib/hyperparser.py | 4 ++-- Lib/idlelib/rpc.py | 4 ++-- Lib/idlelib/run.py | 2 +- Lib/idlelib/searchengine.py | 2 +- 6 files changed, 8 insertions(+), 8 deletions(-) diff --git a/Lib/idlelib/editor.py b/Lib/idlelib/editor.py index 6c52efd..859a288 100644 --- a/Lib/idlelib/editor.py +++ b/Lib/idlelib/editor.py @@ -1301,7 +1301,7 @@ class EditorWindow: want = ((have - 1) // self.indentwidth) * self.indentwidth # Debug prompt is multilined.... ncharsdeleted = 0 - while 1: + while True: chars = chars[:-1] ncharsdeleted = ncharsdeleted + 1 have = len(chars.expandtabs(tabwidth)) diff --git a/Lib/idlelib/history.py b/Lib/idlelib/history.py index 100f505..5a9b32a 100644 --- a/Lib/idlelib/history.py +++ b/Lib/idlelib/history.py @@ -65,7 +65,7 @@ class History: self.text.bell() return nprefix = len(prefix) - while 1: + while True: pointer += -1 if reverse else 1 if pointer < 0 or pointer >= nhist: self.text.bell() diff --git a/Lib/idlelib/hyperparser.py b/Lib/idlelib/hyperparser.py index 77baca7..76144ee 100644 --- a/Lib/idlelib/hyperparser.py +++ b/Lib/idlelib/hyperparser.py @@ -237,9 +237,9 @@ class HyperParser: last_identifier_pos = pos postdot_phase = True - while 1: + while True: # Eat whitespaces, comments, and if postdot_phase is False - a dot - while 1: + while True: if pos>brck_limit and rawtext[pos-1] in self._whitespace_chars: # Eat a whitespace pos -= 1 diff --git a/Lib/idlelib/rpc.py b/Lib/idlelib/rpc.py index 8efcf04..62eec84 100644 --- a/Lib/idlelib/rpc.py +++ b/Lib/idlelib/rpc.py @@ -307,7 +307,7 @@ class SocketIO: self.debug("_getresponse:myseq:", myseq) if threading.current_thread() is self.sockthread: # this thread does all reading of requests or responses - while 1: + while True: response = self.pollresponse(myseq, wait) if response is not None: return response @@ -417,7 +417,7 @@ class SocketIO: self.responses and notify the owning thread. """ - while 1: + while True: # send queued response if there is one available try: qmsg = response_queue.get(0) diff --git a/Lib/idlelib/run.py b/Lib/idlelib/run.py index aaa9b5c..577c49e 100644 --- a/Lib/idlelib/run.py +++ b/Lib/idlelib/run.py @@ -145,7 +145,7 @@ def main(del_exitfunc=False): args=((LOCALHOST, port),)) sockthread.daemon = True sockthread.start() - while 1: + while True: try: if exit_now: try: diff --git a/Lib/idlelib/searchengine.py b/Lib/idlelib/searchengine.py index eddef58..0684142 100644 --- a/Lib/idlelib/searchengine.py +++ b/Lib/idlelib/searchengine.py @@ -165,7 +165,7 @@ class SearchEngine: wrapped = 0 startline = line chars = text.get("%d.0" % line, "%d.0" % (line+1)) - while 1: + while True: m = search_reverse(prog, chars[:-1], col) if m: if ok or m.start() < col: -- cgit v0.12 6e Tk is a free and open-source, cross-platform widget toolkit that provides a library of basic elements of GUI widgets for building a graphical user interface (GUI) in many programming languages.
summaryrefslogtreecommitdiffstats
path: root/generic
Commit message (Expand)AuthorAgeFilesLines
* merge core-8-6-branchrfe_6c0d7aec67jan.nijtmans2017-07-031-0/+1
|\
| * Fix [62c5b7a1d7]: [text] segfaults on replace. Patch from Christian Werner.fvogel2017-06-261-0/+1
* | Fix TkUtfPrev()/TkUtfNext() implementation: Surrogates were not handled corre...jan.nijtmans2017-06-161-14/+12
* | merge core-8-6-branchjan.nijtmans2017-06-081-4/+20
|\ \ | |/
| * Fix [bc43fd20cf]: paneconfigure not working as expectedbug_bc43fd20cffvogel2017-05-311-4/+20
* | merge core-8-6-branchjan.nijtmans2017-05-231-1/+2
|\ \ | |/
| * .... missing else ... in previous commitjan.nijtmans2017-05-201-0/+1
| * Bug-fix [434d294df] continuation: fix logic error detected by Christian Werne...jan.nijtmans2017-05-201-1/+1
* | merge core-8-6-branchjan.nijtmans2017-05-191-2/+2
|\ \ | |/
| * Eliminate empty if() statement, if DEBUG_LAYOUT_WITH_BASE_CHUNKS is not defin...jan.nijtmans2017-05-191-2/+2
* | merge core-8-6-branchjan.nijtmans2017-05-194-33/+57
|\ \ | |/
| * Slightly use of more "int" in stead of double, for 100% compatibility at scri...bug_434d294dfjan.nijtmans2017-05-191-15/+14
| |\
| * \ merge trunk. jan.nijtmans2017-05-181-1/+5
| |\ \ | | |/
| * | Another attempt to fix [434d294df8b053246ee86e7898d06bc3a6d1d771|434d294df8],...jan.nijtmans2017-05-153-21/+23
| |/
* | merge core-8-6-branchjan.nijtmans2017-05-184-9/+34
|\ \ | |/
| * Revert [f38091d0]: If TK_LAYOUT_WITH_BASE_CHUNKS is set (MacOSX), this change...jan.nijtmans2017-05-121-1/+1
| * New internal function TkpCancelWarp(), which does a proper warp clean-up when...jan.nijtmans2017-05-103-8/+33
* | merge core-8-6-branchjan.nijtmans2017-05-091-7/+0
|\ \ | |/
| * Remove calls to Tk_FreeXId(), since it's just a NOP.jan.nijtmans2017-05-081-7/+0
* | merge core-8-6-branchjan.nijtmans2017-05-082-3/+3
|\ \ | |/
| * Don't use sizeof(struct) when the structure has a char array as last element:...jan.nijtmans2017-05-082-3/+3
* | Bug-fix: surrogate UTF-8 starts with 0xED, not 0xEB. And in tkUnixRFont.c, ch...jan.nijtmans2017-05-031-5/+5
* | merge core-8-6-branchjan.nijtmans2017-05-032-6/+55
|\ \ | |/
| * Change floor() back to casting to int() in fixing [6020ee2d03].fvogel2017-05-021-6/+3
| |\
| | * Revert the previous commit since it has drawbacks (see [6020ee2d03]).bug_308940ffffvogel2017-05-021-6/+3
* | | Experimental new functions TkUtfPrev/TkUtfNextjan.nijtmans2017-05-024-8/+43
* | | Experimental new function TkUtfCharComplete(), attempt to handle [6c0d7aec67]...jan.nijtmans2017-05-022-0/+15
|/ /
* | Typo (wehter -> whether) and minor consistancy in code comment (grey -> gray)jan.nijtmans2017-05-021-1/+1
* | Fix [e4336bef5d58cc96a438ba0fb5553ea57e94f4d8|e4336bef5d]: Unexpected result ...jan.nijtmans2017-05-011-46/+120
|\ \
| * | Fix [e4336bef5d] (Unexpected result when copying a photo image to itself): if...bug_e4336bef5dsimonbachmann2017-04-301-46/+120
|/ /
* | code styling (wrong indent)jan.nijtmans2017-04-181-3/+3
* | Fix [2912962fff]: Notebook does not set TTK_STATE_USER1 and TTK_STATE_USER2.fvogel2017-04-071-6/+21
|\ \
| * | Fixed TTK_STATE_USER2 similarly as TTK_STATE_USER1. These bits are set for th...bug_2912962ffffvogel2017-04-031-4/+11
| * | Fix [2912962fff]: Notebook does not set TTK_STATE_USER1. Patch from Jos Decos...fvogel2017-04-031-2/+10
* | | Fix [3089640fff], [6020ee2d03], [e016579efb], [6bf197edbf] and [7ffb9e554c]: ...fvogel2017-04-071-30/+24
|\ \ \ | | |/ | |/|
| * | Slightly better fix anonymously proposed in [6020ee2d03]. Use floor() instead...fvogel2017-04-061-3/+6
| * | The -mintabwidth style option is honored whenever possible. If there is not e...fvogel2017-04-021-6/+14
| * | Fix [3089640fff], [6020ee2d03], [e016579efb] and [6bf197edbf]: ttk::notebook ...fvogel2017-03-311-25/+8
| |/
* | [db8c541b6b] Prevent access of freed memory in warp pointer callbacks.dgp2017-04-061-2/+23
|/
* Fix [28a3c366e6]: memory leak in the text widget. Patch contributed anonymouslyfvogel2017-03-291-0/+3
|\
| * Fix [28a3c366e6]: memory leak in the text widget. Patch contributed anonymouslybug_28a3c366e6fvogel2017-03-261-0/+3
* | merge core-8-6-branchtip_464fvogel2017-03-261-0/+6
|\ \ | |/
| * Fix [77527326e5]: ttk artifacts on Ubuntu. Patch from Csaba Nemethi.bug_77527326e5fvogel2017-03-101-0/+6
* | merge core-8-6-branchfvogel2017-03-06