Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
C
cpython
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Kirill Smelkov
cpython
Commits
7a70ea41
Commit
7a70ea41
authored
Sep 17, 2003
by
Raymond Hettinger
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
SF patch #806246: use basestring where possible
(Contributed by George Yoshida.)
parent
d21fd7bd
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
3 additions
and
3 deletions
+3
-3
Lib/doctest.py
Lib/doctest.py
+1
-1
Lib/pkgutil.py
Lib/pkgutil.py
+1
-1
Lib/test/test_textwrap.py
Lib/test/test_textwrap.py
+1
-1
No files found.
Lib/doctest.py
View file @
7a70ea41
...
...
@@ -1187,7 +1187,7 @@ def _normalize_module(module):
module
=
sys
.
_getframe
(
2
).
f_globals
[
'__name__'
]
module
=
sys
.
modules
[
module
]
elif
isinstance
(
module
,
(
str
,
unicode
)
):
elif
isinstance
(
module
,
basestring
):
# The ["*"] at the end is a mostly meaningless incantation with
# a crucial property: if, e.g., module is 'a.b.c', it convinces
# __import__ to return c instead of a.
...
...
Lib/pkgutil.py
View file @
7a70ea41
...
...
@@ -50,7 +50,7 @@ def extend_path(path, name):
path
=
path
[:]
# Start with a copy of the existing path
for
dir
in
sys
.
path
:
if
not
isinstance
(
dir
,
(
str
,
unicode
)
)
or
not
os
.
path
.
isdir
(
dir
):
if
not
isinstance
(
dir
,
basestring
)
or
not
os
.
path
.
isdir
(
dir
):
continue
subdir
=
os
.
path
.
join
(
dir
,
pname
)
# XXX This may still add duplicate entries to path on
...
...
Lib/test/test_textwrap.py
View file @
7a70ea41
...
...
@@ -23,7 +23,7 @@ class BaseTestCase(unittest.TestCase):
for
i
in
range
(
len
(
textin
)):
result
.
append
(
" %d: %r"
%
(
i
,
textin
[
i
]))
result
=
'
\
n
'
.
join
(
result
)
elif
isinstance
(
textin
,
(
str
,
unicode
)
):
elif
isinstance
(
textin
,
basestring
):
result
=
" %s
\
n
"
%
repr
(
textin
)
return
result
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment