Skip to content

Commit

Permalink
removed dependency on futures
Browse files Browse the repository at this point in the history
  • Loading branch information
davidcaron committed Mar 28, 2017
1 parent 026c78c commit cccf9ce
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 5 deletions.
12 changes: 8 additions & 4 deletions laspy/header.py
@@ -1,5 +1,4 @@
# noinspection PyCompatibility
from builtins import str
import datetime
import uuid
from laspy import util
Expand All @@ -12,6 +11,11 @@
except NameError:
xrange = range

try:
string_type = basestring
except NameError:
string_type = str

def leap_year(year):
if ((year % 4) != 0):
return False
Expand Down Expand Up @@ -211,7 +215,7 @@ def set_property(self, name, value):
packed = struct.pack(fmt.full_fmt, value)
elif isinstance(value, bytes):
packed = value
elif isinstance(value, str):
elif isinstance(value, string_type):
packed = value.encode()
else:
packed = struct.pack(fmt.full_fmt, *value)
Expand Down Expand Up @@ -364,7 +368,7 @@ def pack(self, name, val):
spec = self.fmt.lookup[name]
if isinstance(val, bytes):
return val
elif isinstance(val, str):
elif isinstance(val, string_type):
return val.encode()
elif spec.num == 1:
return(struct.pack(spec.full_fmt, val))
Expand Down Expand Up @@ -477,7 +481,7 @@ def pack(self, name, val):
spec = self.fmt.lookup[name]
if isinstance(val, bytes):
return val
elif isinstance(val, str):
elif isinstance(val, string_type):
return val.encode()
elif spec.num == 1:
return(struct.pack(spec.fmt, val))
Expand Down
2 changes: 1 addition & 1 deletion setup.py
Expand Up @@ -40,7 +40,7 @@
www.laspy.org, and the source is available at
www.github.com/grantbrown/laspy''',
packages = ['laspy', 'laspytest','laspy.tools'],
install_requires = ['numpy', 'future'],
install_requires = ['numpy'],
test_suite = 'laspytest.test_laspy',
data_files = [("laspytest/data", ["simple.las", "simple1_3.las", "simple1_4.las", "simple.laz"])],
include_package_data = True,
Expand Down

0 comments on commit cccf9ce

Please sign in to comment.