@autorest/python 6.4.13 → 6.4.14

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -58,32 +58,35 @@ def _timedelta_as_isostr(td: timedelta) -> str:
58
58
  if days:
59
59
  date_str = "%sD" % days
60
60
 
61
- # Build time
62
- time_str = "T"
61
+ if hours or minutes or seconds:
62
+ # Build time
63
+ time_str = "T"
63
64
 
64
- # Hours
65
- bigger_exists = date_str or hours
66
- if bigger_exists:
67
- time_str += "{:02}H".format(hours)
65
+ # Hours
66
+ bigger_exists = date_str or hours
67
+ if bigger_exists:
68
+ time_str += "{:02}H".format(hours)
68
69
 
69
- # Minutes
70
- bigger_exists = bigger_exists or minutes
71
- if bigger_exists:
72
- time_str += "{:02}M".format(minutes)
70
+ # Minutes
71
+ bigger_exists = bigger_exists or minutes
72
+ if bigger_exists:
73
+ time_str += "{:02}M".format(minutes)
73
74
 
74
- # Seconds
75
- try:
76
- if seconds.is_integer():
77
- seconds_string = "{:02}".format(int(seconds))
78
- else:
79
- # 9 chars long w/ leading 0, 6 digits after decimal
80
- seconds_string = "%09.6f" % seconds
81
- # Remove trailing zeros
82
- seconds_string = seconds_string.rstrip("0")
83
- except AttributeError: # int.is_integer() raises
84
- seconds_string = "{:02}".format(seconds)
85
-
86
- time_str += "{}S".format(seconds_string)
75
+ # Seconds
76
+ try:
77
+ if seconds.is_integer():
78
+ seconds_string = "{:02}".format(int(seconds))
79
+ else:
80
+ # 9 chars long w/ leading 0, 6 digits after decimal
81
+ seconds_string = "%09.6f" % seconds
82
+ # Remove trailing zeros
83
+ seconds_string = seconds_string.rstrip("0")
84
+ except AttributeError: # int.is_integer() raises
85
+ seconds_string = "{:02}".format(seconds)
86
+
87
+ time_str += "{}S".format(seconds_string)
88
+ else:
89
+ time_str = ""
87
90
 
88
91
  return "P" + date_str + time_str
89
92
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@autorest/python",
3
- "version": "6.4.13",
3
+ "version": "6.4.14",
4
4
  "description": "The Python extension for generators in AutoRest.",
5
5
  "main": "index.js",
6
6
  "repository": {