Skip to content

Commit

Permalink
Use ImportError for Python2 compatibility
Browse files Browse the repository at this point in the history
  • Loading branch information
vepadulano committed Mar 30, 2021
1 parent 2e9e420 commit 46401b9
Showing 1 changed file with 3 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -19,10 +19,9 @@

try:
import pyspark
except ModuleNotFoundError:
raise ModuleNotFoundError(
("cannot import module 'pyspark'."
" Please make sure Spark is installed."))
except ImportError:
raise ImportError(("cannot import module 'pyspark'. Refer to the Apache Spark documentation "
"for installation instructions."))


class SparkBackend(Base.BaseBackend):
Expand Down

0 comments on commit 46401b9

Please sign in to comment.