[Notes] [Git][BuildStream/buildstream][master] 2 commits: sandbox/sandbox.py: Use assertions for programming errors instead of BstErrors.



Title: GitLab

Tristan Van Berkom pushed to branch master at BuildStream / buildstream

Commits:

1 changed file:

Changes:

  • buildstream/sandbox/sandbox.py
    ... ... @@ -288,8 +288,8 @@ class Sandbox():
    288 288
                 command = [command]
    
    289 289
     
    
    290 290
             if self.__batch:
    
    291
    -            if flags != self.__batch.flags:
    
    292
    -                raise SandboxError("Inconsistent sandbox flags in single command batch")
    
    291
    +            assert flags == self.__batch.flags, \
    
    292
    +                "Inconsistent sandbox flags in single command batch"
    
    293 293
     
    
    294 294
                 batch_command = _SandboxBatchCommand(command, cwd=cwd, env=env, label=label)
    
    295 295
     
    
    ... ... @@ -326,8 +326,8 @@ class Sandbox():
    326 326
     
    
    327 327
             if self.__batch:
    
    328 328
                 # Nested batch
    
    329
    -            if flags != self.__batch.flags:
    
    330
    -                raise SandboxError("Inconsistent sandbox flags in single command batch")
    
    329
    +            assert flags == self.__batch.flags, \
    
    330
    +                "Inconsistent sandbox flags in single command batch"
    
    331 331
     
    
    332 332
                 parent_group = self.__batch.current_group
    
    333 333
                 parent_group.append(group)
    



  • [Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]