Skip to content

Commit 9173548

Browse files
committed
Bumping yajl-py version to re-upload to pypi fixes #19
1 parent e8fb5cc commit 9173548

File tree

2 files changed

+7
-5
lines changed

2 files changed

+7
-5
lines changed

tests/test_yajl.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -255,17 +255,17 @@ def test_check_yajl_version_warnsOnlyWhenMismatchedVersions(self):
255255
with mock.patch('warnings.warn') as warn:
256256
with mock.patch.multiple(yajl.wrapped,
257257
__version__='1.1.1',
258-
yajl_version='1.1.1',
258+
yajl_version='1.1.2', # major and minor version matching
259259
):
260260
self.assertTrue(yajl.check_yajl_version())
261261
self.assertFalse(warn.called)
262262
with mock.patch.multiple(yajl.wrapped,
263263
__version__='1.1.1',
264-
yajl_version='1.1.0',
264+
yajl_version='1.0.0',
265265
):
266266
self.assertFalse(yajl.check_yajl_version())
267267
warn.assert_called_with(
268-
"Using Yajl-Py v1.1.1 with Yajl v1.1.0. It is advised "
268+
"Using Yajl-Py v1.1.1 with Yajl v1.0.0. It is advised "
269269
"to use the same Yajl-Py and Yajl versions",
270270
RuntimeWarning, stacklevel=3
271271
)

yajl/__init__.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@
2727
'YajlParseCancelled', 'YajlGenException',
2828
'YajlContentHandler', 'YajlParser', 'YajlGen',
2929
]
30-
__version__ = '2.1.1'
30+
__version__ = '2.1.2'
3131
yajl_version = get_yajl_version()
3232

3333
def check_yajl_version():
@@ -37,7 +37,9 @@ def check_yajl_version():
3737
Returns True, if the version of yajl is identical to the version of yajl-py
3838
otherwise displays a RuntimeWarning and returns False.
3939
'''
40-
if __version__ != yajl_version:
40+
p_yajl_py_version = __version__.split('.')
41+
p_yajl_version = yajl_version.split('.')
42+
if p_yajl_py_version[:2] != p_yajl_version[:2]:
4143
import warnings
4244
warnings.warn(
4345
'Using Yajl-Py v%s with Yajl v%s. '

0 commit comments

Comments
 (0)