From f26ec89c4473b805bbcfb889c0cc53aa343227e2 Mon Sep 17 00:00:00 2001 From: Sanath Kumar Ramesh Date: Fri, 31 May 2019 13:04:04 -0700 Subject: [PATCH 1/2] fix: WindowsError keyword is undefined on non-Windows platforms WindowsError is a subclass of `OSError`. It is defined and raised only in Windows. Hence the exception statement will return a `WindowsError keyword is undefined` in other platforms. --- aws_lambda_builders/utils.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/aws_lambda_builders/utils.py b/aws_lambda_builders/utils.py index d5b2ec9aa..1a944c06e 100644 --- a/aws_lambda_builders/utils.py +++ b/aws_lambda_builders/utils.py @@ -36,7 +36,7 @@ def copytree(source, destination, ignore=None): try: # Let's try to copy the directory metadata from source to destination shutil.copystat(source, destination) - except WindowsError as ex: # pylint: disable=undefined-variable + except OSError as ex: # pylint: disable=undefined-variable # Can't copy file access times in Windows LOG.debug("Unable to copy file access times from %s to %s", source, destination, exc_info=ex) From a15dc282cc71de0b855f011be69d2a424ffb3d62 Mon Sep 17 00:00:00 2001 From: Sanath Kumar Ramesh Date: Thu, 6 Jun 2019 16:40:01 -0700 Subject: [PATCH 2/2] Remove pylint disable --- aws_lambda_builders/utils.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/aws_lambda_builders/utils.py b/aws_lambda_builders/utils.py index 1a944c06e..b8e6e3ea7 100644 --- a/aws_lambda_builders/utils.py +++ b/aws_lambda_builders/utils.py @@ -36,7 +36,7 @@ def copytree(source, destination, ignore=None): try: # Let's try to copy the directory metadata from source to destination shutil.copystat(source, destination) - except OSError as ex: # pylint: disable=undefined-variable + except OSError as ex: # Can't copy file access times in Windows LOG.debug("Unable to copy file access times from %s to %s", source, destination, exc_info=ex)