|
7 | 7 | # modification, are permitted under the terms of the BSD License. See
|
8 | 8 | # LICENSE file in the root of the Project.
|
9 | 9 |
|
10 |
| -try: |
11 |
| - from sys import maxint |
12 |
| -except ImportError: |
13 |
| - from sys import maxsize as maxint |
| 10 | +from sys import maxsize |
| 11 | + |
14 | 12 | import numpy as np
|
15 | 13 | from inspect import isclass
|
16 |
| -from six import string_types |
17 | 14 | try:
|
18 | 15 | from collections.abc import OrderedDict
|
19 | 16 | except ImportError:
|
20 | 17 | from collections import OrderedDict
|
21 |
| -import sys |
22 | 18 |
|
23 | 19 | from .util import find as finders
|
24 | 20 | from .compression import Compression
|
@@ -302,13 +298,6 @@ def create_data_frame(self, name="", type_="", col_dict=None,
|
302 | 298 | return self.data_frames[objid]
|
303 | 299 |
|
304 | 300 | util.check_entity_name_and_type(name, type_)
|
305 |
| - if (isinstance(col_dict, dict) |
306 |
| - and not isinstance(col_dict, OrderedDict) |
307 |
| - and sys.version_info[0] < 3): |
308 |
| - raise TypeError("Cannot create a DataFrame from a dictionary " |
309 |
| - "in Python 2 as the order of keys is not " |
310 |
| - "preserved. Please use the OrderedDict class " |
311 |
| - "from the collections module instead.") |
312 | 301 |
|
313 | 302 | if data is not None:
|
314 | 303 | shape = len(data)
|
@@ -358,8 +347,7 @@ def create_data_frame(self, name="", type_="", col_dict=None,
|
358 | 347 | if col_dict is not None:
|
359 | 348 | for nam, dt in col_dict.items():
|
360 | 349 | if isclass(dt):
|
361 |
| - if any(issubclass(dt, st) for st in string_types) \ |
362 |
| - or issubclass(dt, np.string_): |
| 350 | + if issubclass(dt, str) or issubclass(dt, np.string_): |
363 | 351 | col_dict[nam] = util.vlen_str_dtype
|
364 | 352 | if 'U' in str(dt) or dt == np.string_:
|
365 | 353 | col_dict[nam] = util.vlen_str_dtype
|
@@ -398,7 +386,7 @@ def find_sources(self, filtr=lambda _: True, limit=None):
|
398 | 386 | :rtype: list of nixio.Source
|
399 | 387 | """
|
400 | 388 | if limit is None:
|
401 |
| - limit = maxint |
| 389 | + limit = maxsize |
402 | 390 | return finders._find_sources(self, filtr, limit)
|
403 | 391 |
|
404 | 392 | def pprint(self, indent=2, max_length=120, extra=True, start_depth=0):
|
|
0 commit comments