mirror of
https://github.com/python/cpython.git
synced 2025-10-10 00:43:41 +00:00
String method conversion.
This commit is contained in:
parent
5ed1dac4c0
commit
20e4423ade
1 changed files with 2 additions and 2 deletions
|
@ -91,7 +91,7 @@ class Cmd:
|
||||||
pass
|
pass
|
||||||
|
|
||||||
def onecmd(self, line):
|
def onecmd(self, line):
|
||||||
line = string.strip(line)
|
line = line.strip()
|
||||||
if not line:
|
if not line:
|
||||||
return self.emptyline()
|
return self.emptyline()
|
||||||
elif line[0] == '?':
|
elif line[0] == '?':
|
||||||
|
@ -104,7 +104,7 @@ class Cmd:
|
||||||
self.lastcmd = line
|
self.lastcmd = line
|
||||||
i, n = 0, len(line)
|
i, n = 0, len(line)
|
||||||
while i < n and line[i] in self.identchars: i = i+1
|
while i < n and line[i] in self.identchars: i = i+1
|
||||||
cmd, arg = line[:i], string.strip(line[i:])
|
cmd, arg = line[:i], line[i:].strip()
|
||||||
if cmd == '':
|
if cmd == '':
|
||||||
return self.default(line)
|
return self.default(line)
|
||||||
else:
|
else:
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue