diff --git a/bash_kernel/install.py b/bash_kernel/install.py index f123bfc..c0680d2 100644 --- a/bash_kernel/install.py +++ b/bash_kernel/install.py @@ -22,6 +22,14 @@ def install_my_kernel_spec(user=True): print('Installing IPython kernel spec') install_kernel_spec(td, 'bash', user=user, replace=True) +def _is_root(): + """Cross-platform way to check admin rights""" + import ctypes, os + try: + return os.geteuid() == 0 + except AttributeError: + return ctypes.windll.shell32.IsUserAnAdmin() != 0 + def main(argv=None): install_my_kernel_spec()