kconfig: Have Kconfig fail when PROJECT_BINARY_DIR is not set

kconfigfunctions.py will silently set all values to '0' when the
environment variable 'PROJECT_BINARY_DIR' is not set.

But PROJECT_BINARY_DIR not being set indicates an internal error, so
we should instead error out with an appropriate error message.

Silently failing is dangerous and increases debug time. It is better
to fail fast.

Signed-off-by: Sebastian Bøe <sebastian.boe@nordicsemi.no>
diff --git a/scripts/kconfig/kconfigfunctions.py b/scripts/kconfig/kconfigfunctions.py
index 2b59a29..57d515a 100644
--- a/scripts/kconfig/kconfigfunctions.py
+++ b/scripts/kconfig/kconfigfunctions.py
@@ -10,12 +10,16 @@
 # 'string', 'int', 'hex', 'bool'
 
 doc_mode = os.environ.get('KCONFIG_DOC_MODE') == "1"
-bin_dir = os.environ.get('PROJECT_BINARY_DIR')
-conf_file = os.path.join(bin_dir, 'include', 'generated',
-                         'generated_dts_board.conf') if bin_dir else None
+
+# The env var 'PROJECT_BINARY_DIR' must be set
+bin_dir = os.environ['PROJECT_BINARY_DIR']
+
+conf_file = os.path.join(
+    bin_dir, 'include', 'generated', 'generated_dts_board.conf'
+)
 
 dt_defines = {}
-if (not doc_mode) and conf_file and os.path.isfile(conf_file):
+if (not doc_mode) and os.path.isfile(conf_file):
     with open(conf_file, 'r', encoding='utf-8') as fd:
         for line in fd:
             if '=' in line: