       (error nil))))
 
 (defun python/post-init-smartparens ()
-  (add-hook 'inferior-python-mode-hook 'smartparens-mode)
-  (add-hook 'hy-mode-hook 'smartparens-mode)
+  (spacemacs/add-to-hooks 'smartparens-mode '(inferior-python-mode-hook
+                                              hy-mode-hook))
   (defadvice python-indent-dedent-line-backspace
       (around python/sp-backward-delete-char activate)
     (let ((pythonp (or (not smartparens-strict-mode)

    (progn
      (pcase python-auto-set-local-pyenv-version
       (`on-visit
        (add-hook 'hy-mode-hook 'pyenv-mode-set-local-version)
        (add-hook 'python-mode-hook 'spacemacs//pyenv-mode-set-local-version))
       (`on-project-switch
        (add-hook 'projectile-after-switch-project-hook
                  'spacemacs//pyenv-mode-set-local-version)))

  (when (configuration-layer/package-usedp 'anaconda-mode)
      (add-hook 'python-mode-hook
                'spacemacs//disable-semantic-idle-summary-mode t))
  (spacemacs/add-to-hook 'python-mode-hook
                         '(semantic-mode
                           spacemacs//python-imenu-create-index-use-semantic))
  (defadvice semantic-python-get-system-include-path
      (around semantic-python-skip-error-advice activate)
    "Don't cause error when Semantic cannot retrieve include
