Skip to content

Commit dee9c00

Browse files
committed
fix types import
1 parent af07d2f commit dee9c00

File tree

2 files changed

+4
-5
lines changed

2 files changed

+4
-5
lines changed

holoviews/core/util/__init__.py

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -12,14 +12,13 @@
1212
import string
1313
import sys
1414
import time
15-
import types
1615
import unicodedata
1716
import warnings
1817
from collections import defaultdict, namedtuple
1918
from contextlib import contextmanager
2019
from functools import partial
2120
from threading import Event, Thread
22-
from types import FunctionType
21+
from types import FunctionType, GeneratorType
2322

2423
import numpy as np
2524
import param
@@ -507,7 +506,7 @@ def callable_name(callable_obj):
507506
return callable_obj.__name__
508507
elif inspect.ismethod(callable_obj): # instance and class methods
509508
return callable_obj.__func__.__qualname__.replace('.__call__', '')
510-
elif isinstance(callable_obj, types.GeneratorType):
509+
elif isinstance(callable_obj, GeneratorType):
511510
return callable_obj.__name__
512511
else:
513512
return type(callable_obj).__name__

holoviews/core/util/types.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import datetime as dt
22
import inspect
33
import sys
4-
import types
4+
from types import GeneratorType
55

66

77
# gen_types is copied from param, can be removed when
@@ -35,7 +35,7 @@ def gen_types(gen_func):
3535

3636

3737
# Types
38-
generator_types = (zip, range, types.GeneratorType)
38+
generator_types = (zip, range, GeneratorType)
3939

4040

4141
@gen_types

0 commit comments

Comments
 (0)