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
7b4a1084
Commit
7b4a1084
authored
Apr 20, 2012
by
Chris Jerdonek
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Added a hack to get around Python bug #7559:
http://bugs.python.org/issue7559
parent
e1a91258
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
20 additions
and
2 deletions
+20
-2
pystache/commands/render.py
+10
-1
pystache/tests/test_mustachespec.py
+10
-1
No files found.
pystache/commands/render.py
View file @
7b4a1084
...
@@ -13,7 +13,16 @@ try:
...
@@ -13,7 +13,16 @@ try:
except
:
except
:
# The json module is new in Python 2.6, whereas simplejson is
# The json module is new in Python 2.6, whereas simplejson is
# compatible with earlier versions.
# compatible with earlier versions.
import
simplejson
as
json
try
:
import
simplejson
as
json
except
ImportError
:
# Raise an error with a type different from ImportError as a hack around
# this issue:
# http://bugs.python.org/issue7559
from
sys
import
exc_info
ex_type
,
ex_value
,
tb
=
exc_info
()
new_ex
=
Exception
(
"
%
s:
%
s"
%
(
ex_type
.
__name__
,
ex_value
))
raise
new_ex
.
__class__
,
new_ex
,
tb
# The optparse module is deprecated in Python 2.7 in favor of argparse.
# The optparse module is deprecated in Python 2.7 in favor of argparse.
# However, argparse is not available in Python 2.6 and earlier.
# However, argparse is not available in Python 2.6 and earlier.
...
...
pystache/tests/test_mustachespec.py
View file @
7b4a1084
...
@@ -24,7 +24,16 @@ except ImportError:
...
@@ -24,7 +24,16 @@ except ImportError:
# simplejson is. The simplejson package dropped support for Python 2.4
# simplejson is. The simplejson package dropped support for Python 2.4
# in simplejson v2.1.0, so Python 2.4 requires a simplejson install
# in simplejson v2.1.0, so Python 2.4 requires a simplejson install
# older than the most recent version.
# older than the most recent version.
import
simplejson
as
json
try
:
import
simplejson
as
json
except
ImportError
:
# Raise an error with a type different from ImportError as a hack around
# this issue:
# http://bugs.python.org/issue7559
from
sys
import
exc_info
ex_type
,
ex_value
,
tb
=
exc_info
()
new_ex
=
Exception
(
"
%
s:
%
s"
%
(
ex_type
.
__name__
,
ex_value
))
raise
new_ex
.
__class__
,
new_ex
,
tb
file_extension
=
'json'
file_extension
=
'json'
parser
=
json
parser
=
json
else
:
else
:
...
...
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