Skip to content

Commit

Permalink
Merge pull request #321 from CybOXProject/empty_hash_fix
Browse files Browse the repository at this point in the history
Fix handling of empty Hash values
  • Loading branch information
clenk authored Sep 4, 2019
2 parents 85f975a + 0f254ae commit 4f3dad9
Show file tree
Hide file tree
Showing 4 changed files with 4 additions and 8 deletions.
1 change: 0 additions & 1 deletion .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@ language: python
sudo: false # Since this is an older project, this is not the default.
cache: pip
python:
- "2.6"
- "2.7"
- "3.4"
- "3.5"
Expand Down
2 changes: 1 addition & 1 deletion cybox/common/hashes.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ def _set_hash_type(entity, value):
# If the Hash already has a defined type_, exit early:
if entity.type_:
return
if not value:
if not value or not value.value:
return
# The `value` argument should be a HexBinary object, so we look at the
# string in its `value` field.
Expand Down
6 changes: 2 additions & 4 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,8 @@ def get_version():
readme = f.read()

install_requires = [
'importlib ; python_version=="2.6"',
'lxml>=2.2.3',
'lxml>=2.2.3 ; python_version == "2.7" or python_version >= "3.5"',
'lxml>=2.2.3, <4.4.0 ; python_version > "2.7" and python_version < "3.5"',
'mixbox>=1.0.2',
'python-dateutil',
]
Expand All @@ -47,10 +47,8 @@ def get_version():
'License :: OSI Approved :: BSD License',
'Operating System :: OS Independent',
'Programming Language :: Python :: 2',
'Programming Language :: Python :: 2.6',
'Programming Language :: Python :: 2.7',
'Programming Language :: Python :: 3',
'Programming Language :: Python :: 3.3',
'Programming Language :: Python :: 3.4',
'Programming Language :: Python :: 3.5',
'Programming Language :: Python :: 3.6',
Expand Down
3 changes: 1 addition & 2 deletions tox.ini
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
[tox]
envlist = py26, py27, py33, py34, py35, py36, docs
envlist = py27, py34, py35, py36, docs

[testenv]
commands =
Expand All @@ -13,7 +13,6 @@ commands =

[travis]
python =
2.6: py26
2.7: py27, docs
3.4: py34
3.5: py35
Expand Down

0 comments on commit 4f3dad9

Please sign in to comment.