Skip to content

Commit e4eb2b0

Browse files
committed
__defaults__ is available in py27
1 parent 109c17c commit e4eb2b0

File tree

2 files changed

+1
-7
lines changed

2 files changed

+1
-7
lines changed

pre_commit/envcontext.py

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,14 +5,12 @@
55
import contextlib
66
import os
77

8-
from pre_commit import five
9-
108

119
UNSET = collections.namedtuple('UNSET', ())()
1210

1311

1412
Var = collections.namedtuple('Var', ('name', 'default'))
15-
setattr(Var.__new__, five.defaults_attr, ('',))
13+
setattr(Var.__new__, '__defaults__', ('',))
1614

1715

1816
def format_env(parts, env):

pre_commit/five.py

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -11,8 +11,6 @@ def n(s):
1111
return s
1212
else:
1313
return s.encode('UTF-8')
14-
15-
defaults_attr = 'func_defaults'
1614
else: # pragma: no cover (PY3 only)
1715
text = str
1816

@@ -22,8 +20,6 @@ def n(s):
2220
else:
2321
return s.decode('UTF-8')
2422

25-
defaults_attr = '__defaults__'
26-
2723

2824
def to_text(s):
2925
return s if isinstance(s, text) else s.decode('UTF-8')

0 commit comments

Comments
 (0)