mirror of
https://github.com/python/cpython.git
synced 2025-08-24 02:35:59 +00:00
String method conversion.
This commit is contained in:
parent
141971f22a
commit
6b71e747b1
5 changed files with 14 additions and 18 deletions
|
@ -1,7 +1,6 @@
|
|||
"""Utility to compile possibly incomplete Python source code."""
|
||||
|
||||
import sys
|
||||
import string
|
||||
import traceback
|
||||
|
||||
__all__ = ["compile_command"]
|
||||
|
@ -49,8 +48,8 @@ def compile_command(source, filename="<input>", symbol="single"):
|
|||
"""
|
||||
|
||||
# Check for source consisting of only blank lines and comments
|
||||
for line in string.split(source, "\n"):
|
||||
line = string.strip(line)
|
||||
for line in source.split("\n"):
|
||||
line = line.strip()
|
||||
if line and line[0] != '#':
|
||||
break # Leave it alone
|
||||
else:
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue