Commits

Anonymous committed a4538df

Moved set_time to jaraco.util project - kept backward compatibility for now

  • Participants
  • Parent commits 02e94a9

Comments (0)

Files changed (1)

File jaraco/net/http.py

 	dest.close()
 	set_time(fname, mod_time)
 
-def set_time(filename, mod_time):
-	log.debug('Setting modified time to %s', mod_time)
-	mtime = calendar.timegm(mod_time.utctimetuple())
-	atime = os.stat(filename).st_atime
-	os.utime(filename, (atime, mtime))
+try:
+	from jaraco.filesystem import set_time
+except ImportError:
+	# keep a copy here for backward compatibilty
+	def set_time(filename, mod_time):
+		log.debug('Setting modified time to %s', mod_time)
+		mtime = calendar.timegm(mod_time.utctimetuple())
+		atime = os.stat(filename).st_atime
+		os.utime(filename, (atime, mtime))
 
 def wget():
 	get_url(sys.argv[1])