Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -125,7 +125,7 @@ def wait_for_next_tick_or_stop(self):
:return: True if the status is RUNNING at the end. False otherwise.
"""
is_time_to_execute = False
while self._current_state is not ExecutionState.STOPPED and not is_time_to_execute:
while self._current_state != ExecutionState.STOPPED and not is_time_to_execute:
self._time_when_waiting_started = self._clock()
if self._current_state is ExecutionState.PAUSED:
new_state = self._wait_for_resume()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -146,8 +146,9 @@ def _getDescription(self: "Cursor") -> typing.Optional[typing.List[typing.Option
if self.ps is None:
return None
row_desc: typing.List[typing.Dict[str, typing.Union[bytes, int, typing.Callable]]] = self.ps["row_desc"]
if len(row_desc) == 0:
if not row_desc:
return None

columns: typing.List[typing.Optional[typing.Tuple]] = []
for col in row_desc:
columns.append((col["label"], col["type_oid"], None, None, None, None, None))
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -445,7 +445,7 @@ def load_rsa_key(key, key_type, key_encoding):
raise ValueError("Invalid key type and encoding: {} and {}".format(key_type, key_encoding))

kwargs = dict(data=key, backend=default_backend())
if key_type is EncryptionKeyType.PRIVATE:
if key_type == EncryptionKeyType.PRIVATE:
kwargs["password"] = None

loaded_key = loader(**kwargs)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -66,8 +66,8 @@ def encrypt(self, plaintext_data_key, encryption_context):
:returns: Deserialized object containing encrypted key
:rtype: aws_encryption_sdk.internal.structures.EncryptedData
"""
if self.wrapping_algorithm.encryption_type is EncryptionType.ASYMMETRIC:
if self.wrapping_key_type is EncryptionKeyType.PRIVATE:
if self.wrapping_algorithm.encryption_type == EncryptionType.ASYMMETRIC:
if self.wrapping_key_type == EncryptionKeyType.PRIVATE:
encrypted_key = self._wrapping_key.public_key().encrypt(
plaintext=plaintext_data_key, padding=self.wrapping_algorithm.padding
)
Expand Down
6 changes: 5 additions & 1 deletion aws-greengrass-core-sdk-python-master/setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,11 @@


def get_version():
init = open(os.path.join(ROOT,'greengrasssdk','__init__.py')).read()
with open(os.path.join(ROOT,'greengrasssdk','__init__.py')) as fi:
try:
init = fi.read()
finally:
fi.close()
return VERSION_RE.search(init).group(1)


Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1235,9 +1235,7 @@ def _model_name(cls):

def __repr__(self):
attrs = []
for attr, val in self.__dict__.items():
if val is not None:
attrs.append('%s=%r' % (attr, val))
attrs = ['%s=%r' % (attr, val) for attr, val in self.__dict__.items() if val is not None]
return '%s(%s)' % (self.__class__.__name__, ', '.join(attrs))

def __eq__(self, other):
Expand Down
5 changes: 4 additions & 1 deletion sagemaker-spark-master/sagemaker-pyspark-sdk/docs/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,10 @@


def read(fname):
return open(os.path.join(os.path.dirname(__file__), fname)).read()
with open(os.path.join(os.path.dirname(__file__), fname)) as fi:
val = fi.read()

return val


def read_version():
Expand Down