Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 2a691a8

Browse files
committed
Merged revisions 62021,62029,62035-62038,62043-62044,62052-62053 via svnmerge from
svn+ssh://[email protected]/python/trunk ........ r62021 | benjamin.peterson | 2008-03-28 18:11:01 -0500 (Fri, 28 Mar 2008) | 2 lines NIL => NULL ........ r62029 | amaury.forgeotdarc | 2008-03-28 20:42:31 -0500 (Fri, 28 Mar 2008) | 3 lines Correctly call the base class tearDown(); otherwise running test_logging twice produce the errors we see on all buildbots ........ r62035 | raymond.hettinger | 2008-03-29 05:42:07 -0500 (Sat, 29 Mar 2008) | 1 line Be explicit about what efficient means. ........ r62036 | georg.brandl | 2008-03-29 06:46:18 -0500 (Sat, 29 Mar 2008) | 2 lines Fix capitalization. ........ r62037 | amaury.forgeotdarc | 2008-03-29 07:42:54 -0500 (Sat, 29 Mar 2008) | 5 lines lib2to3 should install a logging handler only when run as a main program, not when used as a library. This may please the buildbots, which fail when test_lib2to3 is run before test_logging. ........ r62043 | benjamin.peterson | 2008-03-29 10:24:25 -0500 (Sat, 29 Mar 2008) | 3 lines #2503 make singletons compared with "is" not == or != Thanks to Wummel for the patch ........ r62044 | gerhard.haering | 2008-03-29 14:11:52 -0500 (Sat, 29 Mar 2008) | 2 lines Documented the lastrowid attribute. ........ r62052 | benjamin.peterson | 2008-03-30 14:35:10 -0500 (Sun, 30 Mar 2008) | 2 lines Updated README regarding doc formats ........ r62053 | georg.brandl | 2008-03-30 14:41:39 -0500 (Sun, 30 Mar 2008) | 2 lines The other download formats will be available for 2.6 too. ........
1 parent 7315bad commit 2a691a8

59 files changed

Lines changed: 175 additions & 155 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

Demo/classes/Dbm.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ def test():
5050
value = d[key]
5151
print('currently:', value)
5252
value = eval(input('value: '))
53-
if value == None:
53+
if value is None:
5454
del d[key]
5555
else:
5656
d[key] = value

Demo/curses/ncurses.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
from curses import panel
1010

1111
def wGetchar(win = None):
12-
if win == None: win = stdscr
12+
if win is None: win = stdscr
1313
return win.getch()
1414

1515
def Getchar():

Demo/rpc/mountclient.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -100,7 +100,7 @@ def bindsocket(self):
100100
# This function is called to cough up a suitable
101101
# authentication object for a call to procedure 'proc'.
102102
def mkcred(self):
103-
if self.cred == None:
103+
if self.cred is None:
104104
self.cred = rpc.AUTH_UNIX, rpc.make_auth_unix_default()
105105
return self.cred
106106

Demo/rpc/nfsclient.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -129,7 +129,7 @@ def addpackers(self):
129129
self.unpacker = NFSUnpacker('')
130130

131131
def mkcred(self):
132-
if self.cred == None:
132+
if self.cred is None:
133133
self.cred = rpc.AUTH_UNIX, rpc.make_auth_unix_default()
134134
return self.cred
135135

@@ -170,7 +170,7 @@ def Listdir(self, dir):
170170
for fileid, name, cookie in entries:
171171
list.append((fileid, name))
172172
last_cookie = cookie
173-
if eof or last_cookie == None:
173+
if eof or last_cookie is None:
174174
break
175175
ra = (ra[0], last_cookie, ra[2])
176176
return list
@@ -184,7 +184,7 @@ def test():
184184
else: filesys = None
185185
from mountclient import UDPMountClient, TCPMountClient
186186
mcl = TCPMountClient(host)
187-
if filesys == None:
187+
if filesys is None:
188188
list = mcl.Export()
189189
for item in list:
190190
print(item)

Demo/rpc/rpc.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -260,13 +260,13 @@ def do_call(self):
260260

261261
def mkcred(self):
262262
# Override this to use more powerful credentials
263-
if self.cred == None:
263+
if self.cred is None:
264264
self.cred = (AUTH_NULL, make_auth_null())
265265
return self.cred
266266

267267
def mkverf(self):
268268
# Override this to use a more powerful verifier
269-
if self.verf == None:
269+
if self.verf is None:
270270
self.verf = (AUTH_NULL, make_auth_null())
271271
return self.verf
272272

@@ -317,7 +317,7 @@ def recvrecord(sock):
317317
def bindresvport(sock, host):
318318
global last_resv_port_tried
319319
FIRST, LAST = 600, 1024 # Range of ports to try
320-
if last_resv_port_tried == None:
320+
if last_resv_port_tried is None:
321321
import os
322322
last_resv_port_tried = FIRST + os.getpid() % (LAST-FIRST)
323323
for i in range(last_resv_port_tried, LAST) + \
@@ -811,7 +811,7 @@ def loop(self):
811811
def session(self):
812812
call, host_port = self.sock.recvfrom(8192)
813813
reply = self.handle(call)
814-
if reply != None:
814+
if reply is not None:
815815
self.sock.sendto(reply, host_port)
816816

817817

Demo/tkinter/guido/paint.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ def b1up(event):
5050
def motion(event):
5151
if b1 == "down":
5252
global xold, yold
53-
if xold != None and yold != None:
53+
if xold is not None and yold is not None:
5454
event.widget.create_line(xold,yold,event.x,event.y,smooth=TRUE)
5555
# here's where you draw it. smooth. neat.
5656
xold = event.x

Doc/library/array.rst

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,12 +3,12 @@
33
===================================================
44

55
.. module:: array
6-
:synopsis: Efficient arrays of uniformly typed numeric values.
6+
:synopsis: Space efficient arrays of uniformly typed numeric values.
77

88

99
.. index:: single: arrays
1010

11-
This module defines an object type which can efficiently represent an array of
11+
This module defines an object type which can compactly represent an array of
1212
basic values: characters, integers, floating point numbers. Arrays are sequence
1313
types and behave very much like lists, except that the type of objects stored in
1414
them is constrained. The type is specified at object creation time by using a

Include/object.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -562,7 +562,7 @@ the refcount falls to 0; for
562562
objects that don't contain references to other objects or heap memory
563563
this can be the standard function free(). Both macros can be used
564564
wherever a void expression is allowed. The argument must not be a
565-
NIL pointer. If it may be NIL, use Py_XINCREF/Py_XDECREF instead.
565+
NULL pointer. If it may be NULL, use Py_XINCREF/Py_XDECREF instead.
566566
The macro _Py_NewReference(op) initialize reference counts to 1, and
567567
in special builds (Py_REF_DEBUG, Py_TRACE_REFS) performs additional
568568
bookkeeping appropriate to the special build.

Lib/bsddb/dbshelve.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -135,7 +135,7 @@ def __delitem__(self, key):
135135

136136

137137
def keys(self, txn=None):
138-
if txn != None:
138+
if txn is not None:
139139
return self.db.keys(txn)
140140
else:
141141
return self.db.keys()
@@ -161,7 +161,7 @@ def __repr__(self):
161161

162162

163163
def items(self, txn=None):
164-
if txn != None:
164+
if txn is not None:
165165
items = self.db.items(txn)
166166
else:
167167
items = self.db.items()
@@ -172,7 +172,7 @@ def items(self, txn=None):
172172
return newitems
173173

174174
def values(self, txn=None):
175-
if txn != None:
175+
if txn is not None:
176176
values = self.db.values(txn)
177177
else:
178178
values = self.db.values()

Lib/bsddb/test/test_basics.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -366,7 +366,7 @@ def test03_SimpleCursorStuff(self, get_raises_error=0, set_raises_error=0):
366366
else:
367367
if set_raises_error:
368368
self.fail("expected exception")
369-
if n != None:
369+
if n is not None:
370370
self.fail("expected None: %r" % (n,))
371371

372372
rec = c.get_both(b'0404', self.makeData(b'0404'))
@@ -380,7 +380,7 @@ def test03_SimpleCursorStuff(self, get_raises_error=0, set_raises_error=0):
380380
else:
381381
if get_raises_error:
382382
self.fail("expected exception")
383-
if n != None:
383+
if n is not None:
384384
self.fail("expected None: %r" % (n,))
385385

386386
if self.d.get_type() == db.DB_BTREE:

0 commit comments

Comments
 (0)