Modify

Ticket #105 (new defect)

Opened 5 years ago

remove minor code repetition

Reported by: py4fun@… Owned by: xi
Priority: low Component: pyyaml
Severity: minor Keywords:
Cc:

Description

remove minor code repetition in parser (reuse self.peek_event())

Index: C:/projects/workspace_python/PyYAML_2/lib/yaml/parser.py
===================================================================
--- C:/projects/workspace_python/PyYAML_2/lib/yaml/parser.py	(revision 298)
+++ C:/projects/workspace_python/PyYAML_2/lib/yaml/parser.py	(working copy)
@@ -90,9 +90,7 @@
 
     def check_event(self, *choices):
         # Check the type of the next event.
-        if self.current_event is None:
-            if self.state:
-                self.current_event = self.state()
+        self.peek_event()
         if self.current_event is not None:
             if not choices:
                 return True

Attachments

parser.patch Download (640 bytes) - added by anonymous 5 years ago.

Change History

Changed 5 years ago by anonymous

View

Add a comment

Modify Ticket

Change Properties
<Author field>
Action
as new
as The resolution will be set. Next status will be 'closed'
to The owner will be changed from xi. Next status will be 'new'
The owner will be changed from xi to anonymous. Next status will be 'assigned'
Author


E-mail address and user name can be saved in the Preferences.

 
Note: See TracTickets for help on using tickets.