Skip to content

Commit 0383e87

Browse files
committed
Use python date format code instead of shelling out.
1 parent bd65e70 commit 0383e87

File tree

1 file changed

+3
-6
lines changed

1 file changed

+3
-6
lines changed

stdeb/util.py

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@
1313
import tempfile
1414
import stdeb
1515
from stdeb import log, __version__ as __stdeb_version__
16+
from email.utils import formatdate
1617

1718
if hasattr(os,'link'):
1819
link_func = os.link
@@ -256,12 +257,8 @@ def normstr(s):
256257
return result
257258

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

0 commit comments

Comments
 (0)