Skip to content

Commit

Permalink
Use python date format code instead of shelling out.
Browse files Browse the repository at this point in the history
  • Loading branch information
DanLipsitt committed May 5, 2015
1 parent bd65e70 commit 9dbdb4c
Showing 1 changed file with 3 additions and 6 deletions.
9 changes: 3 additions & 6 deletions stdeb/util.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
import tempfile
import stdeb
from stdeb import log, __version__ as __stdeb_version__
from email.Utils import formatdate

if hasattr(os,'link'):
link_func = os.link
Expand Down Expand Up @@ -256,12 +257,8 @@ def normstr(s):
return result

def get_date_822():
"""return output of 822-date command"""
cmd = '/bin/date'
if not os.path.exists(cmd):
raise ValueError('%s command does not exist.'%cmd)
args = [cmd,'-R']
result = get_cmd_stdout(args).strip()
"""return date string in rfc 822 format"""
result = formatdate()
result = normstr(result)
return result

Expand Down

0 comments on commit 9dbdb4c

Please sign in to comment.