Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
P
pystache_custom
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
OpenEdx
pystache_custom
Commits
7a27321d
Commit
7a27321d
authored
Apr 21, 2012
by
Chris Jerdonek
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Only pull in 2to3-related modules when running Python 3.x.
parent
e226768a
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
7 additions
and
4 deletions
+7
-4
pystache/tests/doctesting.py
+7
-4
No files found.
pystache/tests/doctesting.py
View file @
7a27321d
...
@@ -5,14 +5,18 @@ Exposes a get_doctests() function for the project's test harness.
...
@@ -5,14 +5,18 @@ Exposes a get_doctests() function for the project's test harness.
"""
"""
from
lib2to3.main
import
main
as
lib2to3main
import
doctest
import
doctest
import
os
import
os
import
pkgutil
import
pkgutil
from
shutil
import
copyfile
import
sys
import
sys
import
traceback
import
traceback
if
sys
.
version_info
>=
(
3
,):
# Then pull in modules needed for 2to3 conversion. The modules
# below are not necessarily available in older versions of Python.
from
lib2to3.main
import
main
as
lib2to3main
# new in Python 2.6?
from
shutil
import
copyfile
from
pystache.tests.common
import
PACKAGE_DIR
,
TEXT_DOCTEST_PATHS
from
pystache.tests.common
import
PACKAGE_DIR
,
TEXT_DOCTEST_PATHS
...
@@ -38,8 +42,7 @@ def get_doctests(text_file_dir):
...
@@ -38,8 +42,7 @@ def get_doctests(text_file_dir):
#
#
paths
=
[
os
.
path
.
normpath
(
os
.
path
.
join
(
text_file_dir
,
path
))
for
path
in
TEXT_DOCTEST_PATHS
]
paths
=
[
os
.
path
.
normpath
(
os
.
path
.
join
(
text_file_dir
,
path
))
for
path
in
TEXT_DOCTEST_PATHS
]
py_version
=
sys
.
version_info
if
sys
.
version_info
>=
(
3
,):
if
py_version
>=
(
3
,):
paths
=
_convert_paths
(
paths
)
paths
=
_convert_paths
(
paths
)
suites
=
[]
suites
=
[]
...
...
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