Skip to content

Commit

Permalink
Fixed timedelta.
Browse files Browse the repository at this point in the history
  • Loading branch information
DevReaper0 committed Apr 28, 2022
1 parent 59c0364 commit 96cf47a
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion interpreter/interpreter.py
Original file line number Diff line number Diff line change
Expand Up @@ -449,7 +449,7 @@ def visit_Call(self, node):
given_arg_count = len(collected_args)
original_given_arg_count = given_arg_count

if isinstance(target.argument_list.arguments[-1], NodeSplatArgument):
if len(target.argument_list.arguments) > 0 and isinstance(target.argument_list.arguments[-1], NodeSplatArgument):
if given_arg_count > 0:
new_collected_args = []
for i in range(0, given_arg_count):
Expand Down
2 changes: 1 addition & 1 deletion std/types/timedelta.para
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ let TimeDelta = Type.extend({
max
resolution

func __construct__(self, _weeks, _days, _hours, _minutes, _seconds, _milliseconds, _microseconds) {
func __construct__(self, _weeks = 0, _days = 0, _hours = 0, _minutes = 0, _seconds = 0, _milliseconds = 0, _microseconds = 0) {
if _weeks != null && _weeks > 0 {
self.days += __intern_to_int__(_weeks) * 7;
}
Expand Down

0 comments on commit 96cf47a

Please sign in to comment.