Skip to content

Commit

Permalink
Use 3.8 typing syntax (#3578)
Browse files Browse the repository at this point in the history
Support for PEP 604 union types was added in 3.10:

```python-console
Python 3.8.16 (default, Dec  8 2022, 14:03:21)
[Clang 14.0.0 (clang-1400.0.29.202)] on darwin
Type "help", "copyright", "credits" or "license" for more information.
>>> mystr: str | None = None or str
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
TypeError: unsupported operand type(s) for |: 'type' and 'NoneType'
```

(Also, :walrus:)
  • Loading branch information
jstvz committed Apr 13, 2023
1 parent 39b8a1f commit b8f974c
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions cumulusci/core/config/scratch_org_config.py
Original file line number Diff line number Diff line change
Expand Up @@ -123,7 +123,7 @@ def raise_error() -> NoReturn:

def _build_org_create_args(self) -> List[str]:
args = ["-f", self.config_file, "-w", "120"]
devhub_username: str | None = self._choose_devhub_username()
devhub_username: Optional[str] = self._choose_devhub_username()
if devhub_username:
args += ["--targetdevhubusername", devhub_username]
if not self.namespaced:
Expand All @@ -141,8 +141,7 @@ def _build_org_create_args(self) -> List[str]:
args += [f"adminEmail={self.email_address}"]
if self.default:
args += ["-s"]
instance = self.instance or os.environ.get("SFDX_SIGNUP_INSTANCE")
if instance:
if instance := self.instance or os.environ.get("SFDX_SIGNUP_INSTANCE"):
args += [f"instance={instance}"]
return args

Expand Down

0 comments on commit b8f974c

Please sign in to comment.