Skip to content
This repository has been archived by the owner on Apr 26, 2024. It is now read-only.

Commit

Permalink
Merge pull request #3498 from OlegGirko/fix_attrs_syntax
Browse files Browse the repository at this point in the history
* Use more portable syntax using attrs package.

Newer syntax

    attr.ib(factory=dict)

is just a syntactic sugar for

    attr.ib(default=attr.Factory(dict))

It was introduced in newest version of attrs package (18.1.0)
and doesn't work with older versions.

We should either require minimum version of attrs to be 18.1.0,
or use older (slightly more verbose) syntax.
Requiring newest version is not a good solution because
Linux distributions may have older version of attrs (17.4.0 in Fedora 28),
and requiring to build (and package)
newer version just to use newer syntactic sugar in only one test
is just too much.
It's much better to fix that test to use older syntax.

Signed-off-by: Oleg Girko <ol@infoserver.lv>
  • Loading branch information
hawkowl authored Jul 10, 2018
2 parents ea752bd + 85354bb commit 129ffd7
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 1 deletion.
Empty file added changelog.d/3498.misc
Empty file.
2 changes: 1 addition & 1 deletion tests/server.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ class FakeChannel(object):
wire).
"""

result = attr.ib(factory=dict)
result = attr.ib(default=attr.Factory(dict))

@property
def json_body(self):
Expand Down

0 comments on commit 129ffd7

Please sign in to comment.