Skip to content

Commit

Permalink
Accept MethodType as panel.serve parameter (#1450)
Browse files Browse the repository at this point in the history
Closes #1449
  • Loading branch information
nritsche authored Jun 22, 2020
1 parent 15aa31b commit 295ce22
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions panel/io/server.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@

from contextlib import contextmanager
from functools import partial
from types import FunctionType
from types import FunctionType, MethodType

from bokeh.document.events import ModelChangedEvent
from bokeh.server.server import Server
Expand Down Expand Up @@ -53,7 +53,7 @@ def _eval_panel(panel, server_id, title, location, doc):
from ..pane import panel as as_panel

with set_curdoc(doc):
if isinstance(panel, FunctionType):
if isinstance(panel, (FunctionType, MethodType)):
panel = panel()
if isinstance(panel, BaseTemplate):
doc = panel._modify_doc(server_id, title, doc, location)
Expand Down

0 comments on commit 295ce22

Please sign in to comment.