Skip to content

Commit

Permalink
fix python2.6
Browse files Browse the repository at this point in the history
  • Loading branch information
isnowfy committed Dec 15, 2013
1 parent 607417c commit 60526c9
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 7 deletions.
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ def read(fname):

setup(
name='snownlp',
version='0.9.6',
version='0.9.7',
description='Python library for processing Chinese text',
author='isnowfy',
url='https://github.com/isnowfy/snownlp',
Expand Down
4 changes: 2 additions & 2 deletions snownlp/classification/bayes.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,12 +20,12 @@ def save(self, fname):
d['d'] = {}
for k, v in self.d.items():
d['d'][k] = v.__dict__
if sys.version_info.major == 3:
if sys.version_info[0] == 3:
fname = fname + '.3'
marshal.dump(d, open(fname, 'wb'))

def load(self, fname):
if sys.version_info.major == 3:
if sys.version_info[0] == 3:
fname = fname + '.3'
d = marshal.load(open(fname, 'rb'))
self.total = d['total']
Expand Down
4 changes: 2 additions & 2 deletions snownlp/seg/y09_2047.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ def save(self, fname, iszip=False):
d[k] = v.__dict__
else:
d[k] = v
if sys.version_info.major == 3:
if sys.version_info[0] == 3:
fname = fname + '.3'
if not iszip:
marshal.dump(d, open(fname, 'wb'))
Expand All @@ -37,7 +37,7 @@ def save(self, fname, iszip=False):
f.close()

def load(self, fname, iszip=False):
if sys.version_info.major == 3:
if sys.version_info[0] == 3:
fname = fname + '.3'
if not iszip:
d = marshal.load(open(fname, 'rb'))
Expand Down
4 changes: 2 additions & 2 deletions snownlp/utils/tnt.py
Original file line number Diff line number Diff line change
Expand Up @@ -39,12 +39,12 @@ def save(self, fname):
d[k] = v.__dict__
else:
d[k] = v
if sys.version_info.major == 3:
if sys.version_info[0] == 3:
fname = fname + '.3'
marshal.dump(d, open(fname, 'wb'))

def load(self, fname):
if sys.version_info.major == 3:
if sys.version_info[0] == 3:
fname = fname + '.3'
d = marshal.load(open(fname, 'rb'))
for k, v in d.items():
Expand Down

0 comments on commit 60526c9

Please sign in to comment.