forked from platformio/platformio-core
Use generic MISSING helper
This commit is contained in:
@ -30,7 +30,7 @@ from SCons.Script import DefaultEnvironment # pylint: disable=import-error
|
||||
|
||||
from platformio import exception, fs
|
||||
from platformio.builder.tools import platformio as piotool
|
||||
from platformio.compat import IS_WINDOWS, hashlib_encode_data, string_types
|
||||
from platformio.compat import IS_WINDOWS, MISSING, hashlib_encode_data, string_types
|
||||
from platformio.http import HTTPClientError, InternetIsOffline
|
||||
from platformio.package.exception import (
|
||||
MissingPackageManifestError,
|
||||
@ -571,11 +571,10 @@ class ArduinoLibBuilder(LibBuilderBase):
|
||||
# pylint: disable=no-member
|
||||
if not self._manifest.get("dependencies"):
|
||||
return LibBuilderBase.lib_ldf_mode.fget(self)
|
||||
missing = object()
|
||||
global_value = self.env.GetProjectConfig().getraw(
|
||||
"env:" + self.env["PIOENV"], "lib_ldf_mode", missing
|
||||
"env:" + self.env["PIOENV"], "lib_ldf_mode", MISSING
|
||||
)
|
||||
if global_value != missing:
|
||||
if global_value != MISSING:
|
||||
return LibBuilderBase.lib_ldf_mode.fget(self)
|
||||
# automatically enable C++ Preprocessing in runtime
|
||||
# (Arduino IDE has this behavior)
|
||||
@ -827,11 +826,10 @@ class PlatformIOLibBuilder(LibBuilderBase):
|
||||
|
||||
@property
|
||||
def lib_archive(self):
|
||||
missing = object()
|
||||
global_value = self.env.GetProjectConfig().getraw(
|
||||
"env:" + self.env["PIOENV"], "lib_archive", missing
|
||||
"env:" + self.env["PIOENV"], "lib_archive", MISSING
|
||||
)
|
||||
if global_value != missing:
|
||||
if global_value != MISSING:
|
||||
return self.env.GetProjectConfig().get(
|
||||
"env:" + self.env["PIOENV"], "lib_archive"
|
||||
)
|
||||
|
@ -16,7 +16,7 @@ import json
|
||||
import os
|
||||
|
||||
from platformio import fs, proc, util
|
||||
from platformio.compat import string_types
|
||||
from platformio.compat import MISSING, string_types
|
||||
from platformio.debug.exception import DebugInvalidOptionsError
|
||||
from platformio.project.config import ProjectConfig
|
||||
from platformio.project.helpers import load_build_metadata
|
||||
@ -96,9 +96,8 @@ class DebugConfigBase: # pylint: disable=too-many-instance-attributes
|
||||
|
||||
@property
|
||||
def init_break(self):
|
||||
missed = object()
|
||||
result = self.env_options.get("debug_init_break", missed)
|
||||
if result != missed:
|
||||
result = self.env_options.get("debug_init_break", MISSING)
|
||||
if result != MISSING:
|
||||
return result
|
||||
result = None
|
||||
if not result:
|
||||
|
Reference in New Issue
Block a user