Special check specifically for bytes types

This commit is contained in:
Erik Johnson 2018-04-17 15:34:17 -05:00
parent ee90dd5d95
commit e4182715be
No known key found for this signature in database
GPG key ID: 5E5583C437808F3F

View file

@ -2269,7 +2269,9 @@ def managed(name,
.format(contents_id)
)
if isinstance(use_contents, six.string_types) and str('\0') in use_contents:
if isinstance(use_contents, bytes) and b'\0' in use_contents:
contents = use_contents
elif isinstance(use_contents, six.string_types) and str('\0') in use_contents:
contents = use_contents
else:
validated_contents = _validate_str_list(use_contents)