mirror of
https://github.com/jupyter/notebook.git
synced 2024-12-15 04:00:34 +08:00
Use more pythonic way to check wether module have attribute
closes #303
This commit is contained in:
parent
ac6b6122ff
commit
d16576eb68
@ -149,7 +149,7 @@ def install_nbextension(path, overwrite=False, symlink=False, user=False, prefix
|
||||
ensure_dir_exists(nbext)
|
||||
|
||||
# forcing symlink parameter to False if os.symlink does not exist (e.g., on Windows machines running python 2)
|
||||
if 'symlink' not in dir(os):
|
||||
if not hasattr(os, 'symlink'):
|
||||
symlink = False
|
||||
|
||||
if isinstance(path, (list, tuple)):
|
||||
|
Loading…
Reference in New Issue
Block a user